#include#include int main() { int x = 42; const std::type_info& type = typeid(x); std::cout << "The type of x is " << type.name() << "\n"; double y = 3.14; const std::type_info& type2 = typeid(y); std::cout << "The type of y is " << type2.name() << "\n"; return 0; }
The type of x is i The type of y is dThe mangled names "i" and "d" correspond to the `int` and `double` types, respectively. The `typeid` operator is part of the C++ standard library.