string转int

string str = "123";
int n = atoi(str.c_str());
cout << n << endl;

int转string

#include <sstream>
// int 转 string stringstream ss; int n = 123; string str; ss << n; ss >> str;

 

相关文章:

  • 2022-12-23
  • 2021-11-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-01
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-06
  • 2021-08-18
  • 2021-10-05
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案