Tuesday 17 July 2007

itoa in gcc

It is difficult to find the "itoa" and its alias functions in gcc. Alternatively, we can use sprint() function.

Syntax
#include 
int sprintf( char *buffer, const char *format, ... );
Example
 char result[100];
int num = 24;
sprintf( result, "%d", num );

No comments: