正在加载图片...
◇宏展开:预编译时,用字符串替换宏名 不作语法检查 if (X==YES) printf("correct!n) else if ( X==No printf("error! n) 展开后:f(X=1) printf("correct!n) else if (x==0) printf("error!n 爷引号中的內与宏名祁同也不萓抉 例# define p3.14159 printf(2*P=%f\n,, PI*2) 宏展开:prnt(“2*P=%hn”,3.14159*2);❖宏展开:预编译时,用字符串替换宏名-- -不作语法检查 ❖引号中的内容与宏名相同也不置换 例 #define PI 3.14159 printf(“2*PI=%f\n”,PI*2); 宏展开:printf(“2*PI=%f\n”,3.14159*2); 如 if(x==YES) printf(“correct!\n”); else if (x==NO) printf(“error!\n”); 展开后: if(x==1) printf(“correct!\n”); else if (x==0) printf(“error!\n”);
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有