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
Explain stack unwinding.
Difference between a homogeneous and a heterogeneous container
What is name hiding in c++?
What are pointers used for c++?
What is malloc in c++?
A company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9 percent of their gross sales for that week. For example, a saleperson who sells $5000 worth of merchandise in a week receives $200 plus 9 percent of $5000, or a total of $650. You have been supplied with a list of items sold by each salesperson. The values of these items are as follows: Item Value A 239.99 B 129.75 C 99.95 D 350.89 Write a program that inputs one salesperson's items sold in a week (how many of item A? of item B? etc.) and calculates and displays that salesperson's earnings for that week.
Explain bubble sorting.
Describe the process of creation and destruction of a derived class object?
What are the various arithmetic operators in c++?
Difference between delete and free.
Does c++ cost money?
What are default parameters? How are they evaluated in c++ function?
Is eclipse good for c++?
List the special characteristics of constructor.
List the types of polymorphism in c++?