Skip to content

OOP in C++

For the C++ OOP part (I think I need to teach this to the 2nd year students):

  • Accessibility modifiers
  • The concept and motivation of a vtable (polymorphism, virtual methods)
  • Linear search of implemented vtable vs adjusting the pointer
  • Interfaces (abstract classes without fields) for polymorphism
  • Single inheritance of fields (no pointer adjustment)
  • Virtual inheritance (pointer adjustment)
  • Useless diamond inheritance, how solved at a low level (see link in resources), syntax
  • static_cast, dynamic_cast, reinterpret_cast