c++ type of variable code example
Example 1: c++ variable type
std::cout << "Data-type = " << typeid(YourVariable).name() << "\n";
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();
Example 5: c++ declare variable
std::string str = "text";
int foo = 3;
float bar = 3.14;
double baz = 3.14159265;
Example 6: define type c++
typedef unsigned int u_int;