how to check datatype of a variable in c++ code example
Example 1: how to check datatype of a variable in c++
#include
...
cout << typeid(variable).name() << endl;
Example 2: how to check the datatype of a variable in c++
#include
#include
class someClass { };
int main(int argc, char* argv[]) {
int a;
someClass b;
std::cout<<"a is of type: "<
Example 3: how to know datatype of something in c++
int k;
cout << typeid(k).name() << endl;