Open Qingquan-Li opened 2 years ago
Reference:
#include <iostream> #include <typeinfo> using namespace std; int main() { int an_int = 1; cout << typeid(an_int).name() << endl; // i cout << typeid(-2).name() << endl; // i cout << typeid(3.14).name() << endl; // d cout << typeid('a').name() << endl; // c cout << typeid("Hi").name() << endl; // A3_c cout << typeid("Hello World!").name() << endl; // A13_c cout << typeid(true).name() << endl; // b return 0; }
Reference: