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
Will the following program execute?
What is purpose of new operator?
Describe linked list using C++ with an example.
What is a multimap c++?
What is the type of 'this' pointer? When does it get created?
Can circle be called an ellipse?
We all know that a const variable needs to be initialized at the time of declaration. Then how come the program given below runs properly even when we have not initialized p?
what are Access specifiers in C++ class? What are the types?
What is :: operator in c++?
What are vtable and vptr?
What is the difference between ++ count and count ++?
What is stack unwinding?
What is a pdb file?
What is vector pair in c++?
What is a driver program?