strtoll()

Character array conversion to integer value of type long long int.

  #include <stdlib.h>
  
  unsigned long int strtoul(const char *nptr, char **endptr, int base);  
Parameter

nptr

A pointer to a nul-terminated character string to convert.

endptr

A pointer to the position in nptr that could not be converted.

base

A numberic base between 2 and 36.

Remarks

The strtoll() function converts a character array, pointed to by nptr, expected to represent an integer expressed in radix base to an integer value of type long long int. If the sequence pointed to by nptr is a minus sign, the value resulting from the conversion is negated in the return value.

The base argument in strtoll() specifies the base used for conversion. It must have a value between 2 and 36, or 0. The letters a (or A) through z (or Z) are used for the values 10 through 35; only letters and digits representing values less than base are permitted. If base is 0, then strtoll() converts the character array based on its format. Character arrays beginning with'0' are assumed to be octal, number strings beginning with'0x' or'0X' are assumed to be hexadecimal. All other number strings are assumed to be decimal.

If the endptr argument is not a null pointer, it is assigned a pointer to a position within the character array pointed to by nptr. This position marks the first character that is not convertible to a long int value.

In other than the "C" locale, additional locale-specific subject sequence forms may be accepted. This function skips leading white space.

strtoll() returns an unsigned integer value of type long long int. If the converted value is less than LLONG_MIN, strtoll() returns LLONG_MIN and sets errno to ERANGE. If the converted value is greater than LLONG_MAX, strtoll() returns LLONG_MAX and sets errno to ERANGE. The LLONG_MIN and LLONG_MAX macros are defined in limits.h

This function is not specified in the ISO/IEC standards. It is an extension of the standard library.