The Science of Debugging
Chapter 7


7.1.5 It's a bird, It's a plane, it's super comment

Ever have one of those days when you suddenly need to comment out huge sections of code in a single swoop, only to realize that the section you're hitting already has comments in it?

Bleh right? Either use a C++ style comment and hope it works (//) for each line, or put in multiple pairs of our standard C-style comment. Well, MSVC has a comment that does what you want - use standard C-style comment opener, and close it with the super comment, which looks like this; /**/

For example:

void main(void) {

    printf("Hi!\n");
/*
   // printf("I hate this code!\n");
    printf("Hurrah the code works!\n");
/**/
}
Will end up printing out only 'Hi!'.

I use this on a daily basis to isolate bits of code quickly, and without resorting to preprocessor defines, or annoying standard c++ style comments.



Index
7.1.4 Abara-Ka-Pragma 7.2 Starting the MSVC Debugger