Code:
int num = 12345;
char string[6];
snprintf(string, 6 ,"%d", num);