Explain object slicing in c++?



Explain object slicing in c++?..

Answer / Himanshu Shekhar

Object slicing is a C++ feature that occurs when an object of a derived class is assigned to or passed by reference to a base class. When this happens, the object is converted to its base class type, and any derived-class-specific member functions or data members are not accessible. This results in loss of polymorphic behavior.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

What is an undefined reference/unresolved external symbol error and how do I fix it?

1 Answers  


the first character in the variable name must be an a) special symbol b) number c) alphabet

1 Answers  


Differentiate between an external iterator and an internal iterator? What is the advantage of an external iterator.

1 Answers  


What is setfill c++?

1 Answers  


Is c++ an oop?

1 Answers  


the maximum length of a character constant can be a) 2 b) 1 c) 8

1 Answers  


What is the average salary of a c++ programmer?

1 Answers  


Explain about vectors in c ++?

1 Answers  


Is main a class in c++?

1 Answers  


What is difference between shallow copy and deep copy? Which is default?

1 Answers  


Search for: what is pair in c++?

1 Answers  


how to create window program in c++.please explain.

1 Answers   Microsoft,


Categories