#include<stdio.h>
#include<stdlib.h>
main()
{
float num=3.1415;
printf("float型的num=%f\n",num);
char chFloat[20];
printf("转换为字符串输出:\n");
sprintf(chFloat,"%f",num);
printf("chFloat=%s\n",chFloat);
system("pause");
return 0;
}
【转】sprintf()函数的用法总结
【转】C库-----字符串(string)与整型(int)、浮点型(float)等之间的转换
博客主要总结了C语言中sprintf()函数的用法,还涉及C库中字符串与整型、浮点型等之间的转换内容,聚焦于C语言相关的信息技术知识。

1639

被折叠的 条评论
为什么被折叠?



