Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

atoll - Convert a string into a whole number (long long int)

&pagelevel(4)&pagelevel

Definition

#include <stdlib.h>

long long int atoll(const char *s);

atoll converts a string, to which s points, into a whole number of type long long int. The string to be converted may be formatted as follows:

[{ tab | 'BLANK' }...] [+|-] digit ...

All control characters for white space are legal for tab (see definitiona at isspace).

Return val.

Integer value of type long long int



for strings formatted as described above and representing a numeric value that lies in the permissible range of integers.


0

for strings which do not correspond to the syntax described above.

 

LLONG_MAX or LLONG_MIN

 


in the case of an overflow, depending on the sign.

Notes

atoll() is completely contained in strtoll().
atoll also recognizes strings that begin with digits but then end with any character. atoll cuts off the numeric part, converts it according to the above description, and ignores the rest.

If p is a NULL pointer and base is equal to 10, the only difference between atoll and the strtoll function lies in the error handling.
atoll(s) corresponds to strtoll(s, (char **) NULL, 10).

See also

atof, atoi, atol, strtod, strtol, strtoll, strtoul, strtoull