Standards / Extensions | C or C++ | Dependencies |
---|---|---|
Language Environment |
both | OS/390 V2R9 |
#include <stdlib.h>
long long strtoll(const char * __restrict__ nptr, char ** __restrict__ endptr, int base);
Converts nptr, a character string, to a signed long long value.
If the base is greater than zero, the subject sequence contains decimal digits and letters, possibly preceded by either a plus or a minus sign. The letters a (or A) through z (or Z) represent values from 10 through 36, but only those letters whose value is less than the value of the base are allowed.
>>-+-------------+--+-----+--+----+--+--------+---------------->< '-white space-' +- + -+ +-0--+ '-digits-' '- - -' +-0x-+ '-0X-'
The pointer to the converted characters, even if conversion was unsuccessful, is stored in the object pointed to by endptr, as long as endptr is not a NULL pointer.
If successful, strtoll() returns the converted signed long long value, represented in the string.
If unsuccessful, strtoll() returns 0 if no conversion could be performed. If the correct value is outside the range of representable values, strtoll() returns LLONG_MAX (LONGLONG_MAX) or LLONG_MIN (LONGLONG_MIN), according to the sign of the value. If the value of base is not supported, strtoll() returns 0.
If unsuccessful strtoll() sets errno to one of the following values: