查询有关多行注释的注释。将 想知道标准的视图,以便我们可以创建一个不会遇到编译器特定问题的代码。\\ br 代码。 /> 1.正常评论是 / *评论文字* / 2.多行评论 / *评论文字<新行> 更多评论文字<新行> ....<许多新行> 评论文字* / 1相当常见。标准是否说明了格式2?我怀疑不同的编译器可能会以不同的方式解释2 的问题。 对此问题的任何意见或看法也欢迎。 Sachin
Hi, Have a query regarding comments that extend over multiple-lines. Would like to know if the standard''s view of this, so that we can create a code which doesn''t run into compiler specific issues. 1. A normal comments is /* comment text */ 2. A multiple line comment is /* comment text <new line> more comment text <new line> .... <many new lines> comment text */ 1 is fairly common. Does the standard say anything about format 2 ? I suspect different compilers might interpret 2 differently so the question. Any opinions or views on this issue are also welcome. Sachin
推荐答案" Monk" < SC ****** @ gmail>写道: "Monk" <sc******@gmail> wrote: 1.正常的评论是 / *评论文字* / 2.多行评论是 / *评论文字<新行> 更多评论文字<新行> ...<许多新行> 评论文字* / 1很常见标准是否说明格式2的任何内容? 1. A normal comments is /* comment text */ 2. A multiple line comment is /* comment text <new line> more comment text <new line> ... <many new lines> comment text */ 1 is fairly common. Does the standard say anything about format 2 ?
是的。这是合法的。 来自n869.txt,6.4.9: #[#1]除了字符常量,字符串文字, #或评论,字符/ *引入评论。检查评论的 #内容仅用于识别 #多字节字符并查找字符* / #终止它。 注意:_only_表示mb字符和* /。其他任何内容,包括 换行符,都会被忽略。 Richard
Yes. It is legal. From n869.txt, 6.4.9: # [#1] Except within a character constant, a string literal, # or a comment, the characters /* introduce a comment. The # contents of a comment are examined only to identify # multibyte characters and to find the characters */ that # terminate it. Note: _only_ for mb characters and */. Anything else, including newlines, is ignored. Richard
Monk写道: 查询有关多行注释的注释。会不会想知道标准的这个视图,以便我们可以创建一个不会遇到编译器特定问题的代码。 1。正常评论是 / *评论文字* / 2.多行评论是 / *评论文字<新行> 更多评论文字< ;新行> ....<许多新行> 评论文字* / 1是相当普遍的。标准是否说明了格式2?我是b $ b 你在开玩笑吗?格式2被广泛使用。 Krishanu 怀疑不同的编译器可能会有不同的解释,所以问题。 关于这个问题的任何意见或看法也是受欢迎的。 Sachin Hi, Have a query regarding comments that extend over multiple-lines. Would like to know if the standard''s view of this, so that we can create a code which doesn''t run into compiler specific issues. 1. A normal comments is /* comment text */ 2. A multiple line comment is /* comment text <new line> more comment text <new line> .... <many new lines> comment text */ 1 is fairly common. Does the standard say anything about format 2 ? I Are you joking? format 2 is widely used. Krishanu suspect different compilers might interpret 2 differently so the question. Any opinions or views on this issue are also welcome. Sachin
Monk写道: 查询有关多行的注释。会不会想知道标准的这个视图,以便我们可以创建一个不会遇到编译器特定问题的代码。 1。正常评论是 / *评论文字* / 2.多行评论是 / *评论文字<新行> 更多评论文字< ;新行> ...<许多新行> 评论文字* / 1是相当普遍的。标准是否说明了格式2?我怀疑不同的编译器可能会以不同的方式解释2 问题。 对此问题的任何意见或看法也是受欢迎的。 Hi, Have a query regarding comments that extend over multiple-lines. Would like to know if the standard''s view of this, so that we can create a code which doesn''t run into compiler specific issues. 1. A normal comments is /* comment text */ 2. A multiple line comment is /* comment text <new line> more comment text <new line> ... <many new lines> comment text */ 1 is fairly common. Does the standard say anything about format 2 ? I suspect different compilers might interpret 2 differently so the question. Any opinions or views on this issue are also welcome.
您的C教科书应该告诉您格式2是完全标准的。 您可以根据需要安排尽可能多的新行,但是您需要 之间/ *和* / - Flash Gordon 生活在有趣的时代。 虽然我的电子邮件地址说垃圾邮件,它是真实的,我读了它。
Your C text book should tell you that format 2 is completely standard. You can have as many new lines as you want arranged however you want between the /* and */ -- Flash Gordon Living in interesting times. Although my email address says spam, it is real and I read it.
更多推荐
注释格式:注释扩展到多行
发布评论