How do I check if an object’s type is a particular subclass in C++?
I was thinking along the lines of using typeid() but I don’t know how to ask if that type is a subclass of another class (which, by the way, is abstract) Answer class Base { public: virtual ~Base() {} }; class D1: public Base {}; class D2: public Base {}; int main(int argc,char* argv[]); … Read more