What is object slicing and how can we prevent it?
Answer Posted / prits
When an instance of derived class is assigned to base class
instance object slicing takes place.ie in this case the
derived portion gets truncated and only the base portion
remains.
The problem of object slicing can be prevented by the use
of pure virtual functions.
Is This Answer Correct ? | 38 Yes | 6 No |
Post New Answer View All Answers
What is c++ and its features?
Write some differences between an external iterator and an internal iterator?
Can we make any program in c++ without using any header file and what is the shortest program in c++.
Difference between inline functions and macros?
Explain the difference between static and dynamic binding of functions?
What is a c++ object?
What is virtual base class?
List the types of polymorphism in c++?
What language is a dll written in?
What is a down cast?
Distinguish between a # include and #define.
What is the difference between a template and a macro?
Evaluate the following expression as C++ would do :8 * 9 + 2 * 5 a) 82 b) 79 c) 370 d) list
what is the difference between overloading & overriding? give example.
How are pointers type-cast?