get variable type C++ code example
Example 1: c++ variable type
// Example
std::cout << "Data-type = " << typeid(YourVariable).name() << "\n";
// Syntax
typeid(YourVariable).name()
Example 2: how to check datatype of a variable in c++
#include <typeinfo>
...
cout << typeid(variable).name() << endl;
Example 3: c++ how to check type of variable
typeid(variable).name()
Example 4: print data type of a variable in c++
int x = 5;
typeid(x).name();
//output: i
// i stands for int