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 the use of setfill in c++?
Is c++ a dying language?
What are c++ stream classes?
What are the defining traits of an object-oriented language?
Explain selection sorting. Also write an example.
Incase of a function declaration, what is extern means?
How is static data member similar to a global variable?
Can we get the value of ios format flags?
Array base access faster or pointer base access is faster?
What is the use of function pointer?
What is virtual table?
Give 10 points of differences between C & C++.
What are the two types of comments, and how do they differ?
What is the best c++ book?
What is the use of seekg in c++?