Nested comments in Visual C++?

橙三吉。 提交于 2019-12-10 18:39:08

问题


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

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


回答1:


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

Sorry, no nested comments.




回答2:


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




回答3:


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


来源:https://stackoverflow.com/questions/939753/nested-comments-in-visual-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!