Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C Library Reference - <u>synopsis:</u> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <stdlib.h>
    char *ultoa( unsigned long int value,
                 char *buffer,
                 int radix );
    char *_ultoa( unsigned long int value,
                  char *buffer,
                  int radix );
    wchar_t *_ultow( unsigned long int value,
                     wchar_t *buffer,
                     int radix );
    wchar_t *_ultou( unsigned long int value,
                     wchar_t *buffer,
                     int radix );

Description:
    The ultoa function converts the unsigned binary integer value into the
    equivalent string in base radix notation storing the result in the
    character array pointed to by buffer.  A null character is appended to
    the result.  The size of buffer must be at least 33 bytes when
    converting values in base 2.  The value of radix must satisfy the
    condition:


         2 <= radix <= 36

    The _ultoa function is identical to ultoa.  Use _ultoa for ANSI/ISO
    naming conventions.

    The _ultow function is identical to ultoa except that it produces a
    wide-character string (which is twice as long).

    The _ultow Unicode function is identical to ultoa except that it
    produces a Unicode character string (which is twice as long).

Returns:
    The ultoa function returns the pointer to the result.

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

    void print_value( unsigned long int value )
      {
        int base;
        char buffer[33];

        for( base = 2; base <= 16; base = base + 2 )
          printf( "%2d %s\n", base,
                  ultoa( value, buffer, base ) );
      }

    void main()
      {
        print_value( (unsigned) 12765L );
      }

    produces the following:

     2 11000111011101
     4 3013131
     6 135033
     8 30735
    10 12765
    12 7479
    14 491b
    16 31dd

Classification:
    WATCOM

_ultoa conforms to ANSI/ISO naming conventions

Systems:
     ultoa - All, Netware

    _ultoa - All
    _ultow - All

See Also:
    atoi, atol, itoa, ltoa, sscanf, strtol, strtoul, utoa

See Also:

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson