当前位置: 首页 > news >正文

预处理指令

// The include directive instructs the preprocessor to paste the text of the given file into the current file.
// 粘贴指定文件的内容
#include
// 定义宏PI
#define PI 3.1415926
// 取消定义PI
#undef PI

条件编译(Conditional Compilation)

// 检查xxx是否已被定义为宏,如果是,则到#endif为止的内容都包含进来
#ifdef xxx...
#endif
// 检查xxx是否没有被宏定义
// One common use of '#ifndef' is to include code only the first time a header file is included.
#ifndef xxx...
#endif
// 如果condition为true,则includes the code until the closing #endif.
// 如果不是true,则不包含
#if condition...
#endif
The '#endif' directive closes off the following directives: #if, #ifdef, or #ifndef.
In other words, '#endif' always matches the nearest '#ifdef' (or '#ifndef', or '#if').

endif
ifdef

http://www.lryc.cn/news/164717.html

相关文章:

  • 强大的JTAG边界扫描(1):基本原理介绍
  • 【C++】源文件.cpp和头文件.h分离编程
  • 报错ssh: Could not resolve hostname
  • 从零开始学网站建设:从需求分析到上线发布
  • 软件系统验收测试需要注意的地方
  • 解决three.js中加载纹理贴图时,初次渲染不显示的问题
  • Git学习记录
  • 建筑模板木模好还是钢模好
  • 写代码中碰到的错误
  • java文件传输简单方法
  • Vue3后台管理系统Element-plus_侧边栏制作_无限递归
  • PCIe基础概念
  • GE IS220PVIBH1A 336A4940CSP16 数字输入模块
  • 比特币与火人节
  • Nginx 中 location 和 proxy_pass 斜杠/ 问题
  • 【Spring】开发框架Spring核心技术含Resource接口详细讲解
  • 【随想】每日两题Day.5 (实则一题)
  • 【LeetCode刷题笔记】动态规划 — 70.爬楼梯
  • 2024腾讯校招后端面试真题汇总及其解答(三)
  • mysql的分组group by
  • Swoole 介绍以及 编译安装
  • Ubuntu终端指令
  • python给json 转实体类加注释的代码实现
  • 绘制三角波与梯形波
  • 【Git】 git push 提示Not possible to fast-forward,无法提交也无法提交程序
  • 优思学院|为什么质量工程师在别人看是“救火“的呢?
  • VMware Explore | 联想与VMware扩大合作带来生成式AI和多云解决方案
  • 8月份徒弟企业面试后反馈的软件测试面试题(含金量高请收藏)
  • 私有云不是真正的云计算!
  • netperf 测试时延和吞吐