1.包含头文件#include <stdlib.h>
2.介绍:
描述
C 库函数 double atof(const char *str) 把参数 str 所指向的字符串转换为一个浮点数(类型为 double 型)。
声明
下面是 atof() 函数的声明。
double atof(const char *str)
参数
str – 要转换为浮点数的字符串。
返回值
函数返回转换后的双精度浮点数,如果没有执行有效的转换,则返回零(0.0)。
3.使用示例
1.包含头文件#include <stdlib.h>
2.介绍:
描述
C 库函数 double atof(const char *str) 把参数 str 所指向的字符串转换为一个浮点数(类型为 double 型)。
声明
下面是 atof() 函数的声明。
double atof(const char *str)
参数
str – 要转换为浮点数的字符串。
返回值
函数返回转换后的双精度浮点数,如果没有执行有效的转换,则返回零(0.0)。
3.使用示例