views:

417

answers:

3

Is it possible to enable nested comments (/* /* */ */) in Visual C++?

I can't seem to find the switch, if there is one.

+5  A: 

I don't think it's possible using that style of quote. The first "*/" will always "close" the quote.

ChrisF
Note: This is true of C++ (the language), not just Visual C++ (the implementation).
Avi
+3  A: 

Nested comments are not allowed in the C++ standard. Visual C++ supports this standard.

Sorry, no nested comments.

gbrandt
Thanks. I was sure I was once able to do this, but maybe I'm mistaken.
+2  A: 

I don't believe that is possible, but if you want to "comment out" a chunk of code which itself contains comments, you could always use the preprocessor,

#ifdef NOT_REQUIRED

/**
 * foo
 */
 void foo()
 { 

 }

#endif
Paul Dixon
I frequently use "#if 0" - the code can easily be re-enabled by changing the 0 to a 1.
Graeme Perrow