• 注释


    作用:用于对代码进行解释说明

    单行注释:

      \.........

    多行注释:

      *  ......

          ...... 

          ...... *

    嵌套注释:

           #if condition

          ...

            #endif

        #if 0
            cout << "branch1" << endl; //执行该语句
        #else
            cout << "branch2" << endl;
        #endif
    
    
        #if 1
            cout << "branch1" << endl;
        #else
            cout << "branch2" << endl;  //执行该语句
        #endif

      这种形式对程序调试也可以帮助,测试时使用 #if 1 来执行测试代码,发布后使用 #if 0 来屏蔽测试代码

      #if 后可以是任意的条件语句

      下面的代码如果 condition 条件为 true 执行 code1 ,否则执行 code2

      #if condition
        code1
      #else
        code2
      #endif
  • 相关阅读:
    Python float() 函数
    Python bytearray() 函数
    scanner.nextInt()与scanner.nextDouble
    Scanner对象next与nextLine
    JavaDoc
    包机制
    运算符要点
    变量与常量
    test
    类型转换
  • 原文地址:https://www.cnblogs.com/shiliye/p/13746458.html
Copyright © 2020-2023  润新知