#include <iostream>
#include <sstream>
#include<cstring>
int main()
{
? ? ? ? int val = int();
? ? ? ? char ch = char();
? ? ? ? string str = string();
? ? ? ? cout << val << endl;
? ? ? ? cout << "char is: " << ch << endl;
? ? ? ? cout << (int)ch << endl;
? ? ? ? cout << "string is: " << str << endl;
????????cout << "string size: " << strlen(str.c_str()) << endl;
? ? ? ? stringstream ?itost;
? ? ? ? itost << str;
? ? ? ? int x;
? ? ? ? itost >> x;
? ? ? ? cout << "to i: "<< x << endl;
? ? ? ? cout << stoi(str.c_str()) << endl;
? ? ? ? return 0;
}
输出结果为: