What is object slicing and how can we prevent it?
Answer Posted / vikas
Object slicing occurs when we assign an instance of the
subclass to a variable of type base class.
http://www.cppquestions.com/viewtopic.php?f=17&t=49
Is This Answer Correct ? | 12 Yes | 9 No |
Post New Answer View All Answers
Explain object slicing in c++?
What is an adjust field format flag?
What do you mean by vtable and vptr in c++?
Explain how the virtual base class is different from the conventional base classes of the opps.
Can static member variables be private?
In which situation the program terminates before reaching the breakpoint set by the user at the beginning of the mainq method?
What is ios class in c++?
How can you quickly find the number of elements stored in a static array? Why is it difficult to store linked list in an array?
What is the equivalent of Pascal's Real a) unsigned int b) float c) char
What are the benefits of oop in c++?
What is the difference between an external iterator and an internal iterator?
Why cout is used in c++?
Difference between a homogeneous and a heterogeneous container
Show the declaration for a pointer to function returning long and taking an integer parameter.
Difference between pointer to constant vs. Pointer constant