In addition, I will give you a modified source code, which is equivalent to _atoi64, and the number returned is long long, which can support the processing of numbers greater than 4294967295.
long long MY_atol( const char *nptr)
{
int c; /* Current character */
Long long zong; /* Current Total */
Int symbol; /* If'-',it is negative, otherwise it is positive */
/* Skip blank space */
while(is space((int)(unsigned char)* nptr))
++ nptr;
c =(int)(unsigned char)* nptr++;
Symbol = c;; /* Save the flag instruction */
if (c == '-' || c == '+')
c =(int)(unsigned char)* nptr++; /* Skip symbol */
Total = 0;
while (isdigit(c)) {
Total = 10 * total+(c-'0'); /* Cumulative number */
c =(int)(unsigned char)* nptr++; /* Get the next character */
}
If (symbol = ='-')
Return-Total;
other
Returns the total; /* Returns the result and negates it if necessary */
}