回复 8楼 GBH1
程序代码:
#include<stdio.h>
#include<stdlib.h>
int main()
{
float kt = 40.536738;
char* s = NULL;
sprintf(s,"%.2f\n",kt);
printf("%d\n", s);
float target = atof(s);
printf("%f\n", target);
return 0;
}
结果是:
0
0.000000
好像是没办法的...
[此贴子已经被作者于2017-7-26 10:23编辑过]