c++ get data type code example
Example 1: how to check datatype of a variable in c++
#include <typeinfo>
...
cout << typeid(variable).name() << endl;
Example 2: cpp get data type
#include <typeinfo>
...
cout << typeid(variable).name() << endl;
Example 3: c++ get data type
// Example
std::cout << "Data-type = " << typeid(YourVariable).name() << "\n";
// Syntax
typeid(YourVariable).name()