Код: Выделить всё
class O {
public:
std::string typename(){ return typeid(*this).name(); }
}
class C : public O { /* ... */ }
O* varb = new C();
cout typename(); //
Подробнее здесь: [url]https://stackoverflow.com/questions/21061129/how-can-i-obtain-dynamic-type-name-in-c[/url]
Мобильная версия