- 0
- 0
- 约2.21千字
- 约 4页
- 2017-07-26 发布于河南
- 举报
c语言中预编译指令的应用
#if #ifdef和#ifndef的用法和区别#if #ifdef和#ifndef用法移位运算符的优先级高于条件运算符,重载是不能改变运算符优先级的,这点要注意,所以代码应当像下面这样调整,写宏的时候一定要注意优先级,尽量用括号来屏蔽运算符优先级。#define MAXIMUM(x,y) ((x)(y)?(x):(y))#define MINIMUM....#includestdio.h??#define MAX??#define MAXIMUM(x,y) xy?x:y?#define MINIMUM(x,y) xy?x:y??int main()?{???? int a=10,b=20;??#ifdef MAX???? printf(40:The larger one is %dn,MAXIMUM(a,b));?#else???? printf(40:The lower one is %dn,MINIMUM(a,b));?#endif???#ifndef MIN???? printf(40:The lower is %dn,MINIMUM(a,b));?#else???? printf(40:The larger one is %dn,MAXIMUM(a,b));?#endif??#undef MAX?#ifdef MAX???? printf(40:The larger on
您可能关注的文档
- Conceit 奇特的比喻.docx
- Connotative Meanings of Red(红色的内涵含义).doc
- CONTRAVENCIONES Y DELITOS DE TRáNSITO-2008.docx
- Controlling chaos based on an adaptive nonlinear compensating mechanism修改稿(For final review).doc
- Coolite Toolkit自学实例八-验证.docx
- CPU温控及节电技术.ppt
- CSS常用原子类base.docx
- CST2014快捷键.doc
- CTRL+R运行指令.doc
- CSMP性格系统.doc
原创力文档

文档评论(0)