What is the object Slicing Feature in C++
C / C++ / MFC
2
Posts
2
Posters
0
Views
1
Watching
-
Hello Friends, What is object slicing in c++ ? Why this feature used in c++ ? Is any advantage of object slicing in c++. Kindly Help. -PHIJO MATHEW PHILIP. PHIJO MATHEW PHILIP
-
Hello Friends, What is object slicing in c++ ? Why this feature used in c++ ? Is any advantage of object slicing in c++. Kindly Help. -PHIJO MATHEW PHILIP. PHIJO MATHEW PHILIP
It's not a feature, it's more because you pass a polymorphic object by value instead of passing a pointer to it. So, your object is truncated and you have unexpected results. So, we cannot say that it has advantages :-D See at the bottom of this page[^] for more info.
Cédric Moonen Software developer
Charting control [v1.1]