check for datatype in c ++ code example
Example 1: how to check datatype of a variable in c++
#include <typeinfo>
...
cout << typeid(variable).name() << endl;
Example 2: c++ how to check type of variable
typeid(variable).name()
#include <typeinfo>
...
cout << typeid(variable).name() << endl;
typeid(variable).name()