[ First ] [ Previous ] [ Next ] [ Last ] [ Manuals ]
strtoul

Character array conversion to integer value of type unsigned long int.
Compatibility:
This function is compatible with the following targets:
Prototype:
unsigned long int strtoul(const char *nptr,
  char **endptr, int base);
Parameters:
Parameters for this facility are:
Remarks:
The strtoul() function converts a character array, pointed to by nptr, to an integer value of type unsigned long int, in base. A plus or minus sign prefix is ignored.
The base argument in strtoul() specifies the base used for conversion. It must have a value between 2 and 36, or 0. If base is 0, then strtol() and strtoul() convert 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 the functions' respective types.
This function skips leading white space.
This function sets the global variable errno to ERANGE if there is a conversion error.
Return:
strtoul() returns an unsigned integer value of type unsigned long int. If the converted value is greater than ULONG_MAX, strtoul() returns ULONG_MAX and sets errno to ERANGE. The ULONG_MAX macro is defined in limits.h
See Also:
"strtod"
"strtol"
"errno"
"Integral type limits"
"Overview of math.h"
For example of strtoll() usage:
Refer to "Example of strtol(), strtoul(), strtoll(), and strtoull() usage".
[ First ] [ Previous ] [ Next ] [ Last ] [ Manuals ]
Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.
Last updated: August 16, 2000