OOP in C
staff.washington.edu
OOP in C
1–10 of 149 posts
Re: OOP in C
#2https://www.cs.rit.edu/~ats/books/ooc.pdf
(edit: link updated to point to author's website)
Re: OOP in C
#3A whole book on this topic was already written in 1993 by Axel-Tobias Schreiner. It seems to be freely available nowadays: https://www.cs.rit.edu/~ats/books/ooc.pdf (edit: link updated to point to author's website)
Re: OOP in C
#4Re: OOP in C
#5Re: OOP in C
#6all that memory map stuff is completely out of whack, along with much else
Re: OOP in C
#7Re: OOP in C
#8A whole book on this topic was already written in 1993 by Axel-Tobias Schreiner. It seems to be freely available nowadays: https://www.cs.rit.edu/~ats/books/ooc.pdf (edit: link updated to point to author's website)
I remember having a book on the shelf through the 90s entitled 'Object Oriented Programming in Macro Assembler'
Re: OOP in C
#9[flagged]
Yes, Structures in C can be used as classes. And yes, this includes polymorphism.
My solution was to put a callback in the structure that would point to the implementation that was polymorphic. This allowed me to pass the struct around and then call the specific implementation at the right time.
When you write OOP in C you do not need to make it look like OOP language. You just need to understand what OOP is about and use the existing language to do what you need it to do as efficiently as possible.
As to spending time on writing functionality that is readily available in other languages... sometimes you just don't have a choice. There are programming environments where ANSI C is the only language available as was in my case.
Please, try not to be too dismissive to the things you do not understand.