function to get variable type c++ code example
Example 1: c++ how to check type of variable
typeid(variable).name()
Example 2: how to know datatype of something in c++
int k;
cout << typeid(k).name() << endl;
typeid(variable).name()
int k;
cout << typeid(k).name() << endl;