将整数转为字符串1.sprintf(str,"%d",a);将整数a转为字符串存在str中2.snprintf(str,n,"%d",a);将整数a前n-1个数转为字符串存在str中,只读n-1个,第n个存放\0