Name of a type

suggest change

You 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

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents