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


Please Help Members By Posting Answers For Below Questions

Which c++ operator cannot overload?

762


What is the use of namespace std in C++?

855


Explain virtual class and friend class.

817


How java is different from c and c++?

960


What is the use of setfill in c++?

827


What is expression parser in c++

2169


What is the default access level?

847


What is an iterator?

958


write a function signature with various number of parameters.

823


Why do you use the namespace feature?

891


What is an undefined behavior and sequence points

767


List the issue that the auto_ptr object handles?

829


Explain terminate() function?

818


What is rtti in c++?

877


What are c++ tokens?

818