I'm trying to figure out how to convert a string to an int without using atoi(). I'm doing a programming excersise from a book I'm reading, and it says
"Use the character classification functions to prepare an implementation of atoi()." So that means using the ctype.h functions...
But short of creating an entire algorithm to find the number of digits of the int, then multiplying the 1st digit by 10^n, then add the second digit times 10^n-1 and so on. Is that what I need to do? Or is there a way simpler process to do this? Maybe someone could just explain how the atoi() function does its thing, I couldn't find the source code anywhere through google and just opening up stdlib.h didn't make much sense to me...