this post was submitted on 18 Jun 2023
9 points (100.0% liked)
Programming
13458 readers
41 users here now
All things programming and coding related. Subcommunity of Technology.
This community's icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
There are a few approaches to implementing OOP in C. The language doesn't give you any constructs to implement this out of the box, so it's up to the developer to do it. Since there is no definite way to do it, let me just give you some examples and you can decide how to use it in your project:
I would split the C code for this into header and source files:
(header.h)