正文

C# 语言规范--2.3.3 注释2006-09-03 18:35:00

【评论】 【打印】 【字体: 】 本文链接:http://blog.pfan.cn/vc2006/18219.html

分享到:

支持两种形式的注释:单行注释和带分隔符的注释。单行注释以字符 // 开头并延续到源行的结尾。带分隔符的注释以字符 /* 开头,以字符 */ 结束。带分隔符的注释可以跨多行。 comment:(注释:) single-line-comment(单行注释)delimited-comment(带分隔符的注释) single-line-comment:(单行注释:) //   input-charactersopt(//   输入字符可选) input-characters:(输入字符:) input-character(输入字符)input-characters   input-character(输入字符   输入字符) input-character:(输入字符:) 除换行符外的任何 Unicode 字符 new-line-character:(换行符:) 回车符 (U+000D)换行符 (U+000A)行分隔符 (U+2028)段落分隔符 (U+2029) delimited-comment:(带分隔符的注释:) /*   delimited-comment-charactersopt   */(/*   带分隔符的注释字符可选   */) delimited-comment-characters:(带分隔符的注释字符:) delimited-comment-character(带分隔符的注释字符)delimited-comment-characters   delimited-comment-character(带分隔符的注释字符   带分隔符的注释字符) delimited-comment-character:(带分隔符的注释字符:) not-asterisk(非星号)*   not-slash(*   非斜杠) not-asterisk:(非星号:) 除 * 外的任何 Unicode 字符 not-slash:(非斜杠:) 除 / 外的任何 Unicode 字符 注释不嵌套。字符序列 /* 和 */ 在 // 注释中没有任何特殊含义,字符序列 // 和 /* 在带分隔符的注释中没有任何特殊含义。 在字符和字符串文本内不处理注释。 示例/* Hello, world program This program writes "hello, world" to the console */ class Hello { static void Main() { System.Console.WriteLine("hello, world"); } } 包含一个带分隔符的注释。 示例// Hello, world program // This program writes "hello, world" to the console // class Hello // any name will do for this class { static void Main() { // this method must be named "Main" System.Console.WriteLine("hello, world"); } } 显示了若干单行注释。

阅读(1775) | 评论(0)


版权声明:编程爱好者网站为此博客服务提供商,如本文牵涉到版权问题,编程爱好者网站不承担相关责任,如有版权问题请直接与本文作者联系解决。谢谢!

评论

暂无评论
您需要登录后才能评论,请 登录 或者 注册