int to char* and char* to int
int to char* and char* to int
//方法一(int to char* )
int i=5;
char num[16];
memset(num,'\0',sizeof(num));
sprintf(num, "%d",i)
printf("%s",num);//5
// 方法二(int to char* )
//#include <stdlib.h>
num[0] = '\0';
itoa(i , num, 10); //按十进制转换 int to char *
printf("%s",num);//5
i = 0;
i = atoi(str);//char * to int
printf("%d",i);//5