- 整型转字符串:to_string(int val);
- 字符串转整型:stoi(string str);、stol、stoll
#include <iostream>
#include <string>
using namespace std;
int main(){
int a = 1234;
float b = 3.14159265;
cout << "int to string: " << to_string(a) << endl;<
#include <iostream>
#include <string>
using namespace std;
int main(){
int a = 1234;
float b = 3.14159265;
cout << "int to string: " << to_string(a) << endl;<