Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Useful C Macros

Name: Anonymous 2010-01-12 15:24

Let's share the macros we use that make our C code really EXPERT!!

Right now I'm specifically interested in macros to add half-assed object orientation. Thanks!!

I'll contribute myself:
#define mainstart int main(int argc, char **argv) {

Name: Anonymous 2010-01-13 23:15

#define swap(a, b, type) do {type t = a; a = b; b = t;} while (0)

or, if you don't care about portability:

#define swap(a, b) do {typeof(a) t = a; a = b; b = t;} while (0)

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List