 | | Both strtol and strtoul scan str up to the first character inconsistent with a number in the given base. Leading white space is ignored while a leading minus sign produces a negative number. If ptr is non-null, then a pointer to the character in str that terminated the scan is placed into it. Legal inputs to strtol and strtoul are determined by the value of base. If base is 10, decimal numbers are assumed; if base is 16, hexadecimal numbers are assumed, and so forth. Following an optional minus sign, leading zeros are ignored and, if base is 16, a leading 0X or 0x is ignored, too. If base is zero, the string itself determines the base. Following an optional sign, a leading zero indicates octal (base 8), a leading 0X or 0x indicates hexadecimal, and anything else indicates decimal. | |
|