Are you asking how to use it???
If so, the "man" page...
NAME
atoi - convert a string to an integer.
SYNOPSIS
#include <stdlib.h>
int atoi(const char *nptr);
DESCRIPTION
The atoi() function converts the initial portion of the
string pointed to by nptr to int. The behaviour is the
same as
strtol(nptr, (char **)NULL, 10);
except that atoi() does not detect errors.
RETURN VALUE
The converted value.
...if you are asking how it works internally, you can look at...
...or the GNU source...
int atoi(const char *number)
{
register int n = 0, neg = 0;
while (*number <= ' ' && *number > 0)
++number;
if (*number == '-')
{
neg = 1;
++number;
}
else if (*number == '+')
++number;
while (*number>='0' && *number<='9')
n = (n * 10) + ((*number++) - '0');
return (neg ? -n : n);
}