名字来源:array to floating point numbers 的缩写
用 法: double atof(const char *nptr);
#include <iostream>
#include <stdlib.h>
#include <string>
int main()
{
//std::string ss("478");
char *str = "123";
double f_ss;
f_ss = atof(str);
std::cout<<f_ss/2<<std::endl;
return 0;
}
运行结果:61.5