convert a string to long integer representation
#include <stdlib.h> long int atol( const char *ptr );
The atol() function converts the string pointed to by ptr to long int representation.
The converted value.
#include <stdlib.h>
void main()
{
long int x;
x = atol( "-289" );
}
ANSI
| Safety: | |
|---|---|
| Interrupt handler | Yes |
| Signal handler | Yes |
| Thread | Yes |
atoi(), itoa(), ltoa(), sscanf(), strtol(), strtoul(), ultoa(), utoa()