c++
std::string test("11);
int startid = std::stoi(test);
注意:test 为空,则会抛出异常
string str = std::to_string(startid)
c
char buf[32];
sprintf(buf,"%d",11);
int num = strtol("11",null,10);
如果字符串为空,则返回0
c++
std::string test("11);
int startid = std::stoi(test);
注意:test 为空,则会抛出异常
string str = std::to_string(startid)
c
char buf[32];
sprintf(buf,"%d",11);
int num = strtol("11",null,10);
如果字符串为空,则返回0