HOW TO CREATE MY OWN
atoi() function.
pls give me the logic.
its urgent.
One tip: The ASCII value of (char) '0' is (int) 48. So just make a loop and extract these values! Also remember that you have to do the units, tens, hundred math also!
int num=0;
for(i=0;i<strlen(string);i++)
{
num=num+(((int)string-48)*pow(10,i));
}
I think the above code should work!
HINT: switch case, while()/for() loop, if..else
Or are you expecting code?