Alka, I have as much evidence to support my claim as I assume you do, but I believe Exolent's version is faster. Calling natives is not free. I also think this is a better approach.
Code:
stock charToInt(char)
{
if(!('0' <= char <= '9'))
return -1
return char - 48;
}
__________________