oop is a static library, that allows the use of OOP in C language.
Download The Latest Release Of oop Here
- For compiling with GNU's GCC, download
oop-gcc.tar.gz. - For compiling with Microsoft's MSVC, download
oop-msvc.zip.
- For GNU's GCC see GCC Usage.
- For Microsoft's MSVC see MSVC Usage.
When creating a new class with the DEFINE_CLASS_H macro keyword, you actually polymorph the new class with the Object class.
Thus, every class you create, is polymorphed with Object.
Every object is polymorphed with
Legacy_Object(it is the most polymorhpic object in the library).
When you use Objects, you do not need to worry
again about dynamic allocation (e.g. malloc, calloc...).
Objects allocate themselves (with calloc) in
their constructor, and automatically destruct themselves (with free) after
the main.
Although, in case you want to manually invoke the object's destructor (similarly to CPP's delete function) you may do so by invoking the DESTRUCT_OBJECT(objectToDestruct) macro.
Every
Objectis composed ofAutoDestructable, which handles the object to automatically be destructed after themain(seeLegacy_AllocationTableList).
See CONTRIBUTING.md