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
When should you use global variables?
What are the uses of static class data?
What are the advantages of c++ over c?
Why isn't sizeof for a struct equal to the sum of sizeof of each member?
Write about the local class and mention its use?
What are smart pointers?
How does code-bloating occur in c++?
How the delete operator differs from the delete[]operator?
What do you mean by persistent and non persistent objects?
Is c++ still being used?
How do I get good at c++ programming?
List the advantages of inheritance.
In which header file does one find isalpha() a) conio.h b) stdio.h c) ctype.h
What is pure virtual function? Or what is abstract class?
Explain the difference between static and dynamic binding of functions?