int sum=55; char mtext[50]; //将i值写入mtext[50]; sprintf(text,"%d",sum); //将mtext[50]中数字转换成i sscanf(mtext,%d,&sum);