C
Chandra Shekhar Kumar
Derived& Derived:
perator=(const Derived& inDerived)
yes, u r right, see the above. but ideally u shud use dynamic_cast for
polymorphic classes..
{
//to assign to the base class object the following statement
static_cast<Base&>(*this)=inDerived;//works fine
static_cast<Base> (*this)=inDerived;//calls the base class copy constructor.
coz said:*((Base*)this) = inDerived;//works fine
this is same as *(static_cast said:return (*this);
}
I thought the static_cast was equivalent to the C-style cast.
yes, u r right, see the above. but ideally u shud use dynamic_cast for
polymorphic classes..