There’s not much to this, but so that there’s a simple example here:
const char * type_str = typeid (expression).name();
This causes a (compiler-specific) string representing the type of <expression> to be assigned to <type_str>. In the case of MSVC, this is quite a readable representation of the type, but I don’t think the C++ standard imposes much on this other than uniqueness between different types.
The <type_info> structure must have been declared. Thus:
Of course, RTTI must be enabled for the build. In Visual Studio, this option may be found in the project properties under C/C++ | Language.