• C/C++——[03] 注释


    C/C++源程序中被注释的内容不能被编译,被认为是不属于程序的一部分。

    C/C++的注释有两种写法:

    • 多行注释:以 “ /*”开头,以“ */”结尾:
      #include <stdio.h>
      
      /* main function
       print a "Hello World!" string to the stdout
      */
      int main(){
          printf("Hello World!");
          return 0;
      }
    • 单行注释:使用两个斜杠“ //”。从“ //”开始直到行末的内容,都是注释内容:
      #include <stdio.h>
      
      // main function
      // print a "Hello World!" string to the stdout
      int main(){
          printf("Hello World!");
          return 0;
      }

    在C/C++中多行注释是不允许嵌套的,因此推荐一律使用单行注释。

  • 相关阅读:
    CF 13B Letter A
    CF12D Ball
    题解 CF11C
    CF10E Greedy Change
    CF10D LCIS&&Acwing 272
    CF10C Digital Root
    yLOI2019 青原樱
    js有关时间日期的操作
    js 读取 cookie
    nginx有关.htaccess小结
  • 原文地址:https://www.cnblogs.com/oddcat/p/9692500.html
Copyright © 2020-2023  润新知