use snprintf, it's the new more portable itoa
.
itoa is not part of standard C, nor is it part of standard C++; but, a lot of compilers and associated libraries support it.
An example of a sprintf call.
char* buffer = ... allocate a buffer ...
int value = 4564;
sprintf(buffer, "%d", value);
An example of a snprintf call.
char buffer[10];
int value = 234452;
snprintf(buffer, 10, "%d", value);
the difference between sprintf and snprintf is that while sprintf formats in a printf style but writes the result to a string, snprintf formats in a printf style but guarantees no buffer overrun by writing up to a maximum number of characters to a string.
strcpy() =>
strncpy()
sprintf() => snprintf()
strcat() => strncat()