请教下int 如何转换成char

请问下int 怎么转换成char*int id2char* zzHelloWorld我最后要输出成HelloWorld2怎么实现呢?菜鸟

请问下int 怎么转换成char*
int id=2;
char* zz="HelloWorld";

我最后要输出成"HelloWorld2"

怎么实现呢?

菜鸟求助~

[解决办法]


//1.正规点
char buf [20];
sprintf(buf, "%s%d", zz, id);

//2.玩笑 
printf("%s%d\n", zz,id);