搜过好几次了,搜过就忘,不如自己记下来
方式一:
string str = "100"; int a = atoi(str.c_str());
方式二:
string str="100"; int a = stoi(str);