1. int atoi(char * str) 函数2. C++标准库里面的sstream,#include using namespace std;void func() {int number;string str = "1";std::istringstream ss( str ); ss >> number;}详见参考资料