注意:本章节函数都需要#include<string>头文件
#include<iostream>
#include<string>
using namespace std;
int main()
{
string str = "123";
string str2 = "123.456";
int i = stoi(str);
long l = stol(str);
float f = stof(str2);
double d = stod(str2);
cout << i << endl;
cout << l << endl;
cout << f << endl;
cout << d << endl;
string s=to_string(i);
return 0;
}