C++11 运行时变量类型判断
生活随笔
收集整理的這篇文章主要介紹了
C++11 运行时变量类型判断
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
#include <typeinfo>
string name = "cpp";
int age = 14;
cout << typeid(age).name() << endl;
cout << typeid(name).name() << endl;
輸出:
int
class std::basic_string<char,struct std::char_traits,class std::allocator<
char> >
總結(jié)
以上是生活随笔為你收集整理的C++11 运行时变量类型判断的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 个人微信订阅号
- 下一篇: c++ requests网络请求库