Better HN
topnewbestaskshowjobs
Log inSign up

arquivo

3 karma · joined Feb 28, 2015 (11y ago) · 5 submissions

Submissions

comment 11y ago · link · parent

http://pastebin.com/Wesjzs1A

...

comment 11y ago · link · parent

I copied the function from the article, they are identical. This was done intentionally to show how convoluted the article is.

comment 11y ago · link · parent

There is also a version with a normal function:

http://pastebin.com/Wesjzs1A

Solution in the article is overly convoluted.

comment 11y ago · link · parent

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.

comment 11y ago · link · parent

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 and the index number:

http://pastebin.com/vPTTYPpe