#includestdio.h
#includestdlib.h
int main()
{
int a=2013420;
float b=2.054f;
double c=5.24;
char sa[20],sb[20],sc[20];
//将整数a转换为字符串
itoa(a,sa,10);
puts(sa);
//将浮点型数据转换为字符串
sprintf(sb,"%g",b);
puts(sb);
//将double型数据转换为字符串
sprintf(sc,"%lg",c);
puts(sc);
printf("========以下是串转换为数值=========n");
char *s1="123",*s2="1.23";
printf("%dn",atoi(s1));
printf("%gn",atof(s2));
getchar();
return 0;
}