C++随手记--字符串转数字 int,float,double 同理。 #include <sstream> #include <string> int main(){ double num; string str = "123.45"; stringstream ss; ss << str; ss >> num; return 0 } 来源:https://www.cnblogs.com/skyeisgood/p/12488537.html 标签 随手记 string转int num