📌  相关文章
📜  将字符串转换为数字 c++ 代码示例

📅  最后修改于: 2022-03-11 14:44:46.215000             🧑  作者: Mango

代码示例6
//stoi() : The stoi() function takes a string as an argument and 
//returns its value. Supports C++11 or above. 
// If number > 10^9 , use stoll().
#include 
#include 
using namespace std;
main() {
    string str = "12345678";
    cout << stoi(str);
}