Lecture 5 - Slide 5 : 40
Inheritance: Copying and slicing
'Real object-oriented programming' relies on reference semantics (use of pointers or C++ references to objects) rather than value semantics (copying of objects)
slice-1.cc
Illustration of object slicing.
slice-1-output
Program output.
slice-2.cc
Does this variant change the game.
slice-2-output
Program output.
Go to exercise
Slicing an object during parameter passing.