My journey in creating USA Firmware
By setting some basic and simple to follow rules, a C program can be written using object oriented practices.
This comment has been removed by the author.
Although C doesn't have classes, it does have structures, files and headers. By using a file to contain all of the public and private functions (methods) and using two instead of one header file (call them MyObjectMain.h and MyObjectAPI.h) you can emulate private and public methods and attributes. The only 'rule' that requires a slight degree of discipline is to never include the header that contains the 'private' functions in any file other then that of the file with the function declarations corresponding to the header prototypes.
To get access to attributes in a structure, the same technique of using getters and setters should be adhered to. In this case we are requesting attributes that are within a structure vs. a class. But in either case you can acccomplish the same goal.
Great Post beautiful thought i must. Keep sharing the great knowledge and enlightening the thought.Essay Writing