![]() -> Click here to learn how to get live help <- |
ATOIIndexNAMEatoi, atol, atoll, atoq - convert a string to an integerSYNOPSIS#include <stdlib.h> int atoi(const char *nptr); DESCRIPTIONThe fBatoi()fP function converts the initial portion of the string pointed to by fInptrfP to int. The behaviour is the same as
except that fBatoi()fP does not detect errors. The fBatol()fP and fBatoll()fP functions behave the same as fBatoi()fR, except that they convert the initial portion of the string to their return type of fIlongfP or fIlong longfP. fBatoq()fP is an obsolete name for fBatoll()fP. RETURN VALUEThe converted value.CONFORMING TOSVID 3, POSIX.1, BSD 4.3, ISO/IEC 9899. ISO/IEC 9899:1990 (C89) and POSIX.1 (1996 edition) include the functions fBatoi()fP and fBatol()fP only; C99 adds the function fBatoll()fP.NOTESThe non-standard fBatoq()fP function is not present in libc 4.6.27 or glibc 2, but is present in libc5 and libc 4.7 (though only as an inline function in fB<stdlib.h>fP until libc 5.4.44). The fBatoll()fP function is present in glibc 2 since version 2.0.2, but not in libc4 or libc5.SEE ALSOatof(3), strtod(3), strtol(3), strtoul(3)
Index |