Alternatives
Members may post updates or alternatives to this current article in order to show different
approaches or add new features.
22 Aug 2011TheyCallMeMrJames 2 alternatives
If you have two blocks of code that you are testing and need to switch back-and-forth between them, here's a commenting trick that works as a powerful code block toggling mechanism.Say you have a variable called foo of type string and want to change between using initialized values and...
For debug use, you can do something like this:#ifdef DEBUG #define dprintf(...) printf(__VA_ARGS__)#else #define dprintf(...)#endif//Usage:dprintf("In debug mode.");//orchar *foo = "foo";dprintf("%d bar.",foo);// :)/*Edit reason :: *if you type...
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.