字符串转浮点数

float stof(str s);
//s:字符串,支持"123","12.34"

示例

float i;
i=stof("123");      //123.000000
i=stof("123.45");  //123.449997
i=stof("-123.45"); //-123.449997

注意