0x499602D2 0x499602D2 - 1 year ago 62
C++ Question

How do I get the type of a variable?

In C++, how does one find the type of a variable?

Answer Source

You can use the typeid operator:

#include <typeinfo>
...
cout << typeid(variable).name() << endl;