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 the maximum combined length of command line arguments including the space between adjacent arguments?

1042


Is swift a good first language?

1095


Should the member functions which are made public in the base class be hidden?

1078


What is prototype for that c string function?

1193


What is the main purpose of c++?

1107


Write a note about the virtual member function?

1112


What is stream and its types in c++?

1104


which operator is used for performing an exponential operation a) > b) ^ c) none

1112


What is the average salary of a c++ programmer?

1067


What is the difference between the functions rand(), random(), srand() and randomize()?

1363


List different attributes in C++?

1148


What is difference between rand () and srand ()?

1150


What is diamond problem in c++?

1060


Can comments be nested?

1085


Write about the various sections of the executable image?

1031