64,637
社区成员
发帖
与我相关
我的任务
分享
string str="123";
int i;
i = atoi(&str[0]);
#include <sstream>
#include <string>
using namespace std;
string s = "123";
stringstream ss(s);
int value;
ss >> value;
string s = "123";
int n = stoi(s );
string str = "123";
int n = atoi(str.c_str() );