Search code examples
coopc89

Object oriented programming in C


Possible Duplicate:
Can you write object oriented code in C?

Hi, can someone point me to a tutorial explain me how OOP concepts can be implemented in ANSI C:

  • virtual functions
  • inheritance
  • best practice

A book about OOP programming ANSI C would be great too.


Solution

  • Here is the link of a book on this topic: http://www.planetpdf.com/codecuts/pdfs/ooc.pdf (Object Oriented Programming in Ansi-C - exacty what you were looking for).

    Good luck and have patience. Writing OOP in C is not an easy task, but can be somewhat rewarding if you like extreme things !

    Another starting point will be to check GObject: http://library.gnome.org/devel/gobject/ and as @unwind said GTK is a good example of how to use OOP concepts in C. You can also take at GLib, is a nice library that will certainly make your C programming life a lot more easier, it is programmed in OOP manner, and as a plus is portable!