to_string C++ typeid().name()看对象类型

 

 

#include<iostream>
#include <typeinfo>
#include <string>
using namespace std;
int main() {
	int a = 10;
	string s=to_string(a);
	string s1 = "12ppp";
	cout << s1 + s << endl;
	cout << typeid(a).name() << endl;
	cout << typeid(s).name() << endl;
	system("pause");
	return 0;
}

  

posted @ 2022-04-29 20:06  今天也是开心的一天呀  阅读(32)  评论(0)    收藏  举报