int tm=1234567890; char *p = malloc(10*sizeof(char)); sprintf(p,"%d",tm); tm转字符串 printf("--------%s\n",p); int t2; t2 = atoi(p); 字符串转整型 printf("=======%d\n",t2);