float x;
char *s = "7.2339 by these hilts or I am a villian else";
x = atof(s);
/* The %.2f formatting string limits the output to 2 decimal places */
lr_output_message("%.2f", x);
return 0;
}
atof函数在应用时要事先声明!作者: jut984907 时间: 2010-12-21 08:44
欢迎高手赐教,谢谢。作者: andyguo 时间: 2010-12-21 09:17
float x;
char *s = "7.2339 by these hilts or I am a villain else";
double atof(const char *string);
x = atof(s);
/* The %.2f formatting string limits the output to 2 decimal places */
lr_output_message("转换后的数字是%.2f", x);