atof 函数的具体用法?
来源:学生作业帮助网 编辑:作业帮 时间:2024/07/13 17:15:47
atof 函数的具体用法?
atof 函数的具体用法?
atof 函数的具体用法?
欢迎采纳
函数名: atof
功 能: 把字符串转换成浮点数
名字来源:array to floating point numbers 的缩写
用 法: double atof(const char *nptr);
程序例:
#include
#include
int main()
{
float f;
char *str = "12345.67";
f = atof(str);
printf("string = %s float = %f\n", str, f);
return 0;
}