Changing type of object in a conditional
- by David Doria
I'm having a bit of trouble with dynamic_casting. I need to determine at runtime the type of an object. Here is a demo:
include
include
class PersonClass
{
public:
std::string Name;
virtual void test(){}; //it is annoying that this has to be here...
};
class LawyerClass : public PersonClass
{
public:
void GoToCourt(){};
};
class…