Being college students, we know the difficulties that a student will encounter in finding solutions. We are making an effort to help students like us.
If u assign a derived class object to a base class object and try to assess the derived class member using the base class object then slicing problem arrises.Because all the derived class attributes are out of the scope of base class objectKr,Muthu
But this slicing problem occurs when we pass the arguments by value. This problem can be avoided by passing the argument by reference.
when we pass the argument by value the slicing problem occurs. This can be avoided by passing the arguments by reference.Regards,Bhanu.
If u assign a derived class object to a base class object and try to assess the derived class member using the base class object then slicing problem arrises.
ReplyDeleteBecause all the derived class attributes are out of the scope of base class object
Kr,
Muthu
But this slicing problem occurs when we pass the arguments by value. This problem can be avoided by passing the argument by reference.
ReplyDeletewhen we pass the argument by value the slicing problem occurs. This can be avoided by passing the arguments by reference.
ReplyDeleteRegards,
Bhanu.