The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Variadic Macros

No question, just wanted to share. Today I learned something new in C. The last new thing I learned in C was a couple years ago at least, so this is quite an event, there's not that much basic C.

#define MACRO(...) replacement(__VA_ARGS__)

That's how you allow a macro to have a variable number of arguments.
Monday, August 06, 2007
It's worth knowing that variadic macros are new in the C99 standard. Older compilers, perhaps most importantly MSVC6, may not support them.
Wednesday, August 08, 2007

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz