strtol()

carroll at snail.CS.UIUC.EDU carroll at snail.CS.UIUC.EDU
Tue Nov 4 07:32:00 AEST 1986


>From the SysV "Programmers Reference Manual" :

long strtol(str,ptr,base)
char *str,**ptr;
int base;

Strtol returns as a long integer the value represented by the character string
pointed to by str. The string is scanned up to the first character inconsistent
with the base. Leading whitespace is ignored.

If ptr is not NULL, a pointer to the character terminating the scan is
returned.

If base is positive (and <= 36), it is used as the base for conversion. After
an optional leading minus sign, leading zero's are ignored, and a leading
0X or 0x is ignored if base == 16. If base is zero, then a leading zero
indicates base 8, leading 0x or 0X indicates base 16, otherwise it is base
10.



More information about the Comp.unix mailing list