For example:
int a = 12; cout << typeof(a) << endl;
Expected output:
int
Don't forget to include
I believe what you are referring to is runtime type identification. You can achieve the above by doing .
#include #include using namespace std; int main() { int i; cout << typeid(i).name(); return 0; }