Hammer
Hammer

Reputation:

Nested comments in Visual C++?

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

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

Upvotes: 5

Views: 2094

Answers (3)

Paul Dixon
Paul Dixon

Reputation: 301125

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

Upvotes: 4

Gregor Brandt
Gregor Brandt

Reputation: 7799

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

Sorry, no nested comments.

Upvotes: 8

ChrisF
ChrisF

Reputation: 137188

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

Upvotes: 6

Related Questions