Last edited on
So you are saying that I'm not able to use typeid?
If so, could you please show me how dynamic_cast would work?
You can use type id, you just can't use a C-style cast for such cases.
1 2 3 4 5
|
if(typeid(*theArray[i])==typeid(Circle))
{
rad=dynamic_cast<Circle*>(theArray[i])->getRadius();
dynamic_cast<Circle*>(theArray[i])->setRadius(rad*2);
}
|
Last edited on
hm..ok.
Could you show me how It's supposed to be done?
oh sorry, thanks for the help!