ui16toa

Name

ui16toa -- converts integer to string

Synopsis

#include <stdlib.h>

void ui16toa(unsigned long value, char * str, unsigned int radix);

Description

This function converts an unsigned long integer to a null-terminated ASCII string. It accepts a pointer to a string buffer, a value to be converted to a string representation, and the radix in which to represent the number.

Radix may be one of the following:

Table 1. Radix options

radix

representation

2

Binary

8

Octal

10

Decimal

16

Hexidecimal

The string buffer must be long enough to contain all characters created by the conversion. Therefore, the buffer must be sized as follows:

Table 2. Required buffer sizes

representation

size

Binary

17 bytes

Octal

7 bytes

Decimal

6 bytes

Hexadecimal

5 bytes

See Also

i16toa, ui8toa, i8toa, stdlib

Examples

Converting integer to ASCII