sprintf(s,"%s%d%c","test",1,'2'); printf("%s%d%c","test",1,'2'); sprintf函数的功能与printf函数的功能基本一样,只是它把结果输出到指定的字符串中了