Name of a type
suggest changeYou can retrieve the implementation defined name of a type in runtime by using the .name()
member function of the std::type_info
object returned by typeid
.
#include <iostream>
#include <typeinfo>
int main()
{
int speed = 110;
std::cout << typeid(speed).name() << '\n';
}
Output (implementation-defined):
int
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents