get type c++ code example
Example 1: print data type of a variable in c++
int x = 5;
typeid(x).name();
//output: i
// i stands for int
Example 2: c++ get type name of object
#include <iostream>
int main() {
int myNum;
std::cout << typeid(myNum).name();
return 0;
}