#include <iostream>
using namespace std;

int main() {
cout << "test\n";

string str = "789";
int num = atoi(str.c_str());

cout << num;

return 0;
}

C++ string转int_#include