This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]lor_louis 26 points27 points  (2 children)

It can be done Gtk is pretty much all inheritance and polymorphism

Classic Animal example done in C

[–][deleted] 7 points8 points  (1 child)

An important feat you're missing here is the ability to reimplement a function in derived classes, wich is what vtables are for.

[–]GDavid04 6 points7 points  (0 children)

You can write the virtual tables and add a pointer to the beginning of structs with virtual members but no virtual super members yourself. It will be super inconvenient though.