strtoul


Conversion of character string to integer (unsigned long int type) and storing pointer to last character string

[Classification]

Standard library

[Syntax]

#include <stdlib.h>

unsigned long int __far strtoul(const char __near *nptr, char __near * __near *endptr, int base); (C90)

unsigned long int __far strtoul(const char __near * restrict nptr, char __near * __near * restrict endptr, int base); (C99) [V1.07 or later]

unsigned long int __far _COM_strtoul_ff(const char __far *nptr, char __far * __far *endptr, int base); (C90)

unsigned long int __far _COM_strtoul_ff(const char __far * restrict nptr, char __far * __far * restrict endptr, int base); (C99) [V1.07 or later]

[Return value]

Returns the converted value if the partial character string could be converted. If it could not, 0 is returned.

If an overflow occurs, strtoul returns ULONG_MAX and sets macro ERANGE to global variable errno.

[Description]

This function skips 0 or more columns of white-space characters (character which makes the isspace function true) from the start of the string indicated by nptr, and converts the string from the next character into an unsigned long int-type representation. If base is 0, the value is interpreted as the C radix representation. If base is between the range of 2 and 36, the value is interpreted as a radix. When endptr is not the null pointer, the pointer to the remaining strings that were not converted is set to endptr.