zoukankan      html  css  js  c++  java
  • 注释应当准确、易懂,防止注释有二义性

    注释应当准确、易懂,防止注释有二义性。错误的注释不但无益反而 有害。

     1 #include <iostream>
     2 //以下是几个简单宏替换预处理指令
     3 #define  YES        1
     4 #define  PI         3.1415926
     5 #define  RAD        PI/180
     6 #define  MESG       "This is a string."
     7 /* run this program using the console pauser or add your own getch, system("pause") or input loop */
     8 using namespace std;
     9 int main(int argc, char** argv) {
    10        //以下各语句使用了宏替换 
    11     cout<<"YES="<<YES<<endl;
    12     if (YES) 
    13        cout<<"PI="<<PI<<endl;
    14     cout<<"RAD="<<RAD<<endl;
    15     cout<<MESG<<endl;
    16     
    17     return 0;
    18 }
  • 相关阅读:
    2020.12.15
    2020.12.14
    2020.12.13
    2020.12.11
    2020.12.10
    语音合成标记语言(SSML)
    Skyline查询
    win10 VMware 安装 Linux 虚拟机
    图像梯度计算
    Harris Corner Detection
  • 原文地址:https://www.cnblogs.com/borter/p/9413362.html
Copyright © 2011-2022 走看看