int转string一、#include <sstream>
int n = 0;
std::stringstream ss;
std::string str;
ss<<n;
ss>>str;
二、#include <string>
to_string(num);
string转int
std::string str = "123";
int n = atoi(str.c_str());
2023-12-12 14:41:28
int转string一、#include <sstream>
int n = 0;
std::stringstream ss;
std::string str;
ss<<n;
ss>>str;
二、#include <string>
to_string(num);
string转int
std::string str = "123";
int n = atoi(str.c_str());