Borland C++ reference

strtoul

raw OCR

Converts a string to an unsigned long in the given radix.

Defined in header <stdlib.h>

Syntax

#include <stdUb.h>
unsigned  long strtouKconst  char *s, char **endptr, intradix);

Portability

DOSUNIXWindowsANSI CC++ only
■■■

Remarks

strtoul operates the same as strtol, except that it converts a string str to an unsigned long value (where strtol converts to a long). Refer to the entry for strtol for more information.

Return value

strtoul returns the converted value, an unsigned long, or 0 on error.

See also

Example

#include <stdlib.h>
#include <stdio.h>

int main(void)

   char *string = "87654321", *endptr;
   unsigned long Inumber;
   Inumber = strtoul(string, &endptr, 10);
   printf("string = %s  long = %lu\n", string, Inumber);
   return 0;

Differences from modern implementations

Nothing recorded yet.

Modern references

These are search links, not yet checked by hand.

Extraction notes

  • header `stdUb.h` read as `stdlib.h`