Any initial whitespace characters in the string are
skipped. The following characters representing the integer are assumed to be in a
radix specified by the base
argument. Conversion stops once an
unrecognized character is encountered in the string. If the correct converted value
is out of range, the value of the macro ERANGE
is stored in
errno
.
If the value of base
is zero, the characters
representing the integer can be in any valid C constant form (i.e., in decimal,
octal, or hexadecimal), but any integer suffix is ignored. If the value of base is
between 2 and 36 (inclusive), the expected form of the integer characters is a
sequence of letters and digits representing an integer with the radix specified by
base
, optionally preceded by a plus or minus sign, but again,
the integer suffix is ignored. The letters from a
(or
A
) through z
(or Z
) are
ascribed the values 10 through 35; only letters and digits whose ascribed values are
less than that of base
are permitted. If the value of
base
is 16, the characters 0x
or
0X
may optionally precede the sequence of letters and digits,
following the sign if present.