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

Explain about Garbage Collector?

874


What are the general quetions are in DEna bank manager IT/System interviews?

1788


Why is main an int?

749


Why is swift so fast?

857


Define pre-condition and post-condition to a member function in c++?

897


Explain the uses oof nested class?

889


Specify different types of decision control statements?

596


How do I run c++?

800


How to defines the function in c++?

839


What is the size of a vector?

813


Which software is used for c++ programming?

832


How a new operator differs from the operator new?

880


Is swift faster than c++?

759


How is modularity introduced in C++?

949


What is the limitation of cin while taking input for character array?

1732