Syntax
#include <stdlib.h> char *_itoa(int value, char * string, int radix);Description
Note: The space reserved for string must be large enough to hold the returned string. The function can return up to 33 bytes including the null character (\0).
This example converts the integer value -255 to a decimal, a binary, and a hex number, storing its character representation in the array buffer.
#include <stdio.h> #include <stdlib.h> int main(void) { char buffer[35]; char *p; p = _itoa(-255, buffer, 10); printf("The result of _itoa(-255) with radix of 10 is %s\n", p); p = _itoa(-255, buffer, 2); printf("The result of _itoa(-255) with radix of 2\n is %s\n", p); p = _itoa(-255, buffer, 16); printf("The result of _itoa(-255) with radix of 16 is %s\n", p); return 0; /**************************************************************************** The output should be: The result of _itoa(-255) with radix of 10 is -255 The result of _itoa(-255) with radix of 2 is 11111111111111111111111100000001 The result of _itoa(-255) with radix of 16 is ffffff01 ****************************************************************************/ }Related Information