Scenario:
I have a base class called "BaseCls", and two derived classes called
"DerCls1" and "DerCls2"
I declare a variable -
BaseCls *MyClassObj;
I have some code -
If( Condition )
{
MyClassObj = new DerCls1;
} else {
MyClassObj = new DerCls2;
}
How can I tell if MyClassObj is pointing to a DerCls1 or DerCls2
object?
Thanks in advance...
I have a base class called "BaseCls", and two derived classes called
"DerCls1" and "DerCls2"
I declare a variable -
BaseCls *MyClassObj;
I have some code -
If( Condition )
{
MyClassObj = new DerCls1;
} else {
MyClassObj = new DerCls2;
}
How can I tell if MyClassObj is pointing to a DerCls1 or DerCls2
object?
Thanks in advance...
Comment