utoa

Converts an unsigned integer into the equivalent string in base notation

Local Servers:nonblocking
Remote Servers:N/A
Classification:Other
Service:String Conversion

Syntax

  #include <stdlib.h>  
   
  char *utoa  (  
     unsigned int   value,   
     char          *buffer,   
     int            radix);
  

Parameters

value
(IN) Specifies an unsigned integer value.
buffer
(OUT) Points to the character array.
radix
(IN) Specifies a base radix notation.

Return Values

utoa returns the pointer to the result.

Remarks

The utoa function converts the unsigned 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 17 bytes when converting values in base 2.

See Also

atoi, itoa, strtol, strtoul

Example

  #include <stdlib.h>  
   
  void print_value (unsigned int value)  
  {  
     int  base;  
     char buffer[18];  
     for (base=2; base<36; ++base)  
        printf ("%s\n", utoa (value, buffer, base) );  
  }