atof
语法:
1 2 3 |
? #include <stdlib.h> ? double atof( const char *str ); |
功能:将字符串str转换成一个双精度数值并返回结果。 参数str 必须以有效数字开头,但是允许以“E”或“e”除外的任意非数字字符结尾。例如:
1 |
??? x = atof( "42.0is_the_answer" ); |
x的值为42.0.
atof
语法:
1 2 3 |
? #include <stdlib.h> ? double atof( const char *str ); |
功能:将字符串str转换成一个双精度数值并返回结果。 参数str 必须以有效数字开头,但是允许以“E”或“e”除外的任意非数字字符结尾。例如:
1 |
??? x = atof( "42.0is_the_answer" ); |
x的值为42.0.
《atof()函数》上有1条评论
评论已关闭。