Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ strtoul(S) — OpenDesktop Software Development System 3.0.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

strtod(S)

strtol(S)


 strtoul(S)                     6 January 1993                     strtoul(S)


 Name

    strtoul - convert a string to an unsigned long integer

 Syntax


    cc  . . .  -l


    #include <stdlib.h>

    unsigned long strtoul (const char *sptr, char **eptr, int base)


 Description

    The strtoul routine converts a string to an unsigned long integer.  sptr
    points to the start of the string, eptr points to the end of the string,
    and base defines the input radix, for example, base 8 is octal.  base can
    be in the range of a value of zero to 36.

    If base is a value of zero, then the string is assumed to contain the key
    for the base.  The string can start with plus (+) or minus (-), or
    without a sign.  The next character, or the first if a sign is not speci-
    fied, specifies the input radix.  If zero (0), then decimal is assumed.
    If the character is either lowercase ``x'' or ``X'', then hexadecimal is
    assumed; otherwise, octal is assumed.

 Return values

    On success, an unsigned long integer value for the string is returned;
    otherwise, on overflow, errno is set to ERANGE and the value of the
    ULONGMAX constant is returned.

 See also

    strtod(S), strtol(S)

 Standards conformance

    strtoul is an SCO extension. It is conformant with:
    X/Open Portability Guide, Issue 3, 1989;
    IEEE POSIX Std 1003.1-1990 System Application Program Interface (API) [C
    Language] (ISO/IEC 9945-1);
    and ANSI X3.159-1989 Programming Language -- C.



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026