C Reference Manual Reading Notes: 004 Comments

    Standard C supported two stylized comments:

      (1) Begin with the two characters /* and ends with the first subsequent occurence of the two characters */.

      (2) Begin with the characters // and extends up to(but does not include) the next line break.

 

      All comments may take any number of characters and are always treated as whitespace. And comments are not recognized inside string or character constants or within other comments.  The content s of comments are not examined by C implementation except to recognize (and pass over) multibyte characters and line breaks. Comments are removed by the compiler before preprocessing, so preprocessor commands inside comments will not be recognized, and line breaks inside comments do not terminate preprocessor commands. The following two #define commands have the same effect:

        #define ten (2*5)

        #define ten   /* ten

                               * one greater than nine

                               */  (2*5)

 

    Although some non-standard C implementation implement "nestable comments", please do not depend on it and used it.

 

 

    To cause the compiler to ignore large parts of C source, it is best to enclose the parts to be removed with the preprocessor commands

                 #if 0

                 ... ...

                 #endif

    rather than insert /* before and */ after the text. This avoids having to worry about /*-style comments in the enclosed source text.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值