Next: calloc, Previous: atoi, Up: Stdlib

### 2.9 `atoll`—convert a string to a long long integer

Synopsis

         #include <stdlib.h>
         long long atoll(const char *str);
         long long _atoll_r(struct _reent *ptr, const char *str);

Description
The function `atoll` converts the initial portion of the string pointed to by `*`str to a type `long long`. A call to atoll(str) in this implementation is equivalent to strtoll(str, (char **)NULL, 10) including behavior on error.

The alternate function `_atoll_r` is a reentrant version. The extra argument reent is a pointer to a reentrancy structure.

Returns
The converted value.

Portability
`atoll` is ISO 9899 (C99) and POSIX 1003.1-2001 compatable.

No supporting OS subroutines are required.