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
What does h mean in maths?
What is the maximum combined length of command line arguments including the space between adjacent arguments?
What would happen on forgetting [], while deallocating an array through new?
Explain about Virtual Function in C++?
Evaulate: 22%5 a) 2 b) 4 c) 0
Is c++ still being used?
What is the error in the code below and how should it be corrected?
How many standards of c++ are there?
What are the 2 main types of data structures?
What are the basics of local (auto) objects?
What is c++ best used for?
What is the full name of logo?
How can a struct in c++ differs from a struct in c?
List the special characteristics of constructor.
What is a constant? Explain with an example.