/OOP_in_C

Learning OOP in C. Goals: Display Polymorphism, Inheritance.

Primary LanguageC

Aim:

How do we implement a CPP style class in C

How can we add more OOP features to said class

Goal:

Display inhertiance

  • Let a Rectangle class inherit from it's parent, the Shape class

Display Polymorphism

  • In cpp we can use the virtual keyword to let child classes override functions
  • This was the tricky part, understanding how Vtable work and how they point to the functions via function pointers was cool
  • image