Author Topic: Object Oriented C Programming Example  (Read 838 times)

Danny

  • Newbie
  • *
  • Posts: 32
  • Karma: +3/-0
    • View Profile
Object Oriented C Programming Example
« on: October 15, 2017, 05:00:28 am »
Hi people!
I love programming with C but there are some concepts of object oriented programming that are very useful and are not natively supported like they are in C++.
This does not mean that they are not possible to apply in C!
I have made a small example that shows how to implement objects and polymorphism.
This example shows that it is possible to have different objects in an array while being able to use the same functionality on all of them.
I have just finished making this so it has no comments yet (sorry), but I will try to update it in the next few days.
I hope this is helpful for someone  :P

TO DO:
- Commenting code (there are some new comments but nothing really helpful).
- Build an automated tool to generate a skeleton source code

EDIT 1: Version 0.2
- Changed the object header to static, now all objects of the same type share the same header which saves memory.
- Added some defines to the object header to further simplify things.

EDIT 2: Version 0.3:
-Minor API changes to make it easier to understand.
« Last Edit: October 16, 2017, 12:49:09 am by Danny »

mindslight

  • Administrator
  • Full Member
  • *****
  • Posts: 157
  • Karma: +6/-1
    • View Profile
    • Jo Engine
Re: Object Oriented C Programming Example
« Reply #1 on: October 16, 2017, 01:08:07 pm »
Thx for sharing :)

 

Sitemap 1 2 3 4 5 6 7 8 9 10 
SMF spam blocked by CleanTalk