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