#include <stdio.h>
void main()
{
int x=333;
int num=123456;
char str[20];
sprintf(str,"%d",num);
printf("str = %s\n",str);
sprintf(str,"%d",x);
printf("str= %s \n",str);
}
怎样将数字转换为字符串?
最新推荐文章于 2022-12-28 12:46:54 发布
#include <stdio.h>
void main()
{
int x=333;
int num=123456;
char str[20];
sprintf(str,"%d",num);
printf("str = %s\n",str);
sprintf(str,"%d",x);
printf("str= %s \n",str);
}