Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is object slicing and how can we prevent it?

Answer Posted / prits

When an instance of derived class is assigned to base class
instance object slicing takes place.ie in this case the
derived portion gets truncated and only the base portion
remains.

The problem of object slicing can be prevented by the use
of pure virtual functions.

Is This Answer Correct ?    38 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is capacity in vector in c++?

952


Write a program which employs Recursion

1207


Is there a c++ certification?

1002


What is buffering in c++?

1022


Write a struct time where integer m, h, s are its members?

930


What's the order in which the objects in an array are destructed?

1362


What is the purpose of ios::basefield in the following statement?

1211


What flag means?

908


What are the advantages of using a pointer? Define the operators that can be used with a pointer.

1003


What is rvalue?

1095


What are arithmetic operators?

955


What is c++ similar to?

1141


What is the difference between struct and class?

1456


What is c++ coding?

1141


Why struct is used in c++?

1078