http://pastebin.com/Wesjzs1A ...
I copied the function from the article, they are identical. This was done intentionally to show how convoluted the article is.
There is also a version with a normal function: http://pastebin.com/Wesjzs1A Solution in the article is overly convoluted.
Take a look at Object Oriented Programming With ANSI-C. http://www.cs.rit.edu/~ats/books/ It is complicated, but you can take parts from it and built your own system.
Why complicate with multiple files, functions, defines and includes; here it is in one file with a single define: http://pastebin.com/uWSs7ca7 We can improve the macro further by removing the unnecessary if statement…
http://pastebin.com/Wesjzs1A ...
I copied the function from the article, they are identical. This was done intentionally to show how convoluted the article is.
There is also a version with a normal function: http://pastebin.com/Wesjzs1A Solution in the article is overly convoluted.
Take a look at Object Oriented Programming With ANSI-C. http://www.cs.rit.edu/~ats/books/ It is complicated, but you can take parts from it and built your own system.
Why complicate with multiple files, functions, defines and includes; here it is in one file with a single define: http://pastebin.com/uWSs7ca7 We can improve the macro further by removing the unnecessary if statement…