#if的使用

if 后面接的是表达式

#if a==1
code
……
#endif

如果#if后面的表达式能成立,就会把#if和#endif之间的代码编译进去

#if defined的使用

#if defined (x)
code
……

如果x这个宏又被定义过,则把#if和#endif之间的代码编译进去

注意点

  1. 两个都只是用来决定某段代码是否被编译
  2. 记得加#endif

转载于:https://www.cnblogs.com/shenlinken/p/9398814.html

#if、#if defined 的使用相关推荐

  1. The bean 'xxxx.FeignClientSpecification', defined in null, could not be registered. A bean with that

    错误信息: The bean 'sxbs-mall3.FeignClientSpecification', defined in null, could not be registered. A be ...

  2. C++ 预编译的时候使用defined 的含义

    defined 可以理解为定义了 defined(xx) 是否成立的就是xx 是否被宏定义,若果被宏定义了,则成立,如果没有被宏定义,则不成立, 写个demo 理解下 #include <ios ...

  3. NameError: name xx is not defined

    这个问题有很多类型的,这里说下我遇到的这个类型 首先我是获取input 值之后提示NameError: name xx is not defined 最后发现是python 2x 与 python 3 ...

  4. git user name is not defined

    使用android studio 设置git 提交代码的时候弹框提示git user name is not defined 这个是第一次提交代码的时候 输入git仓库的账号和密码 就行了...

  5. Python报错:NameError: name ‘wraps‘ is not defined

    @wraps(func) NameError: name 'wraps' is not defined 解决方法: (1)安装functiontools:pip install functiontoo ...

  6. 解决Neither the JAVA_HOME nor the JRE_HOME environment variable is defined问题

    问题描述: 在cmd窗口使用 startup 命令启动Tomcat时,出现 Neither the JAVA_HOME nor the JRE_HOME environment variable is ...

  7. DllMain already defined in dllmain.obj错误

    错误 uafxcw.lib(dllmodul.obj) : error LNK2005: DllMain already defined in dllmain.obj 修改: 去掉宏定义 _USRDL ...

  8. 2.Python中的reload函数以及not defined reload

    来源: [转]python3中reload() - Excaliburer - 博客园 https://www.cnblogs.com/wangkundentisy/articles/4452449. ...

  9. Target runtime Apache Tomcat 6.0 is not defined

    在problems中显示错误是:Target runtime Apache Tomcat 6.0 is not defined. 在网上查了一下终于找到解决方法.方法是:在工程目录下的.setting ...

  10. Coefficients: (1 not defined because of singularities)

    Coefficients: (1 not defined because of singularities) 目录 Coefficients: (1 not defined because of si ...

最新文章

  1. Android中Handler消息机制
  2. DNS迭代式和递归式域名查询对比
  3. Android中Service深入学习
  4. 【转】读马化腾的产品设计观
  5. 莎拉波顿,莎曼莎考克斯——英伦设计VS美国设计
  6. ashx误删后,未能创建类型
  7. 【MM模块】Document Release 订单下达(审批)
  8. boost::process::on_exit相关的测试程序
  9. hls fifo_HLS优化方法DATAFLOW你用了吗
  10. login控件authenticate_ASP:Login控件(登录控件)
  11. python URLError,HTTPError 的异常处理
  12. 类的多态性:成员变量与成员方法访问特点(C++、Java)
  13. oracle共有同义词,Oracle同义词概念
  14. 根目录在哪里 根目录下的目录有什么作用
  15. css3 标点符号在首位,CSS 让标点符号不出现在行首
  16. 微信小程序不能直接加载本地静态图像作为背景的解决办法
  17. 用 Python 加密文件
  18. python setDaemon
  19. 社区团购热潮退却,谁是电商卖菜“接盘侠”?
  20. android 高德地图标记,android学习之高德地图添加标记

热门文章

  1. 圆形取景框 相机_据说这款设备可以使老旧单反相机解决无线联机拍摄方案
  2. 程序员编程,你的练习是不是有效的?
  3. Swift多线程:GCD进阶,单例、信号量、任务组
  4. mysql的日期和时间函数
  5. 分享:Django学习笔记(4)---ManyToMany 添加、删除关联、查询
  6. 【编程好习惯】通过命名规则区分变量
  7. trang.jar转换xml到Javabean
  8. 想唱你就唱卡拉ok_如何将电唱机与其他设备连接起来
  9. python 重复执行任务_使用Python自动执行数字艺术家的重复任务
  10. linux 开源谷歌浏览器_开发人员浏览器,Google开源版本等