注释应当准确、易懂,防止注释有二义性

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

 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 }
原文地址:https://www.cnblogs.com/borter/p/9413362.html