#include <stdlib.h>long int atol(const char *str);

The atol( ) function converts the string pointed to by str into a long int value. The string must contain a valid integer number. If this is not the case, the returned value is undefined.

The number can be terminated by any character that cannot be part of an integer number. This includes whitespace, punctuation, and characters. This means that if atol( ) is called with “123.23”, the long integer value 123L will be returned, and the “.23” is ignored.

Related functions are atof( ), atoi( ), and atoll( ).

C(s)C++ Programmer's Reference
C Programming on the IBM PC (C Programmers Reference Guide Series)
ISBN: 0673462897
EAN: 2147483647
Year: 2002
Pages: 539 © 2008-2017.
If you may any questions please contact us: