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
What is enum c++?
If there are two catch statements, one for base and one for derived, which should come first?
What is the maximum combined length of command line arguments including the space between adjacent arguments?
When does a name clash occur in c++?
What is the real purpose of class – to export data?
What is data types c++?
How many ways can a variable be initialized into in C++?
What is the use of volatile variable?
How much do coding jobs pay?
If a function doesn’t return a value, how do you declare the function?
Explain polymorphism?
What do you mean by stack unwinding in c++?
What is prototype for that c string function?
What is data hiding c++?
What is c++ namespace?