当前位置:网站首页>预处理和预处理宏
预处理和预处理宏
2022-07-02 17:50:00 【悠然少年心】
//系统自带预处理宏
#include<stdio.h>
void main() {
//region就相当于是一个标签可以把他包裹起来 没有什么实际作用
#pragma region hong
printf("%s \n", __DATE__);//获取年月日
printf("%s \n", __TIME__);//获取时间
printf("%s \n", __FILE__);//获取文件名字
printf("%d \n", __LINE__);//打印当前行数
printf("%d \n", __STDC_HOSTED__);//如果返回1就是满足标准C库
//printf("%d \n", __STDC__)//如果是标准的C编译器可以使用这个 如果不是就会报错
//printf("%d \n", __LP64__);//__LP64__ 判断系统是不是64位 如果是就为1
#pragma endregion hong
system("pause");
}
//宏定义
#pragma once //防止头文件重复包含
#include<stdio.h>
#define OOO 1 //宏定义OOO为1
#undef OOO //解除宏定义
void main() {
#ifdef OOO
printf("0"); //如果有宏定义就返回为真
#else
printf("-1 \n"); //没有就打印-1
#endif // OOO
#ifndef OOO //如果没有定义就返回为真
printf("0"); //如果有宏定义打印0
#else
printf("-1"); //没有就打印-1
#endif // OOO
#if OOO
#else
#endif
system("pause");
}
边栏推荐
- Stm32g0 USB DFU upgrade verification error -2
- Typical application of "stack" - expression evaluation (implemented in C language)
- 从list转化成map的时候,如果根据某一属性可能会导致key重复而异常,可以设置处理这种重复的方式
- 页面标题组件
- 学习八股文的知识点~~1
- 谷歌官方回应:我们没有放弃TensorFlow,未来与JAX并肩发展
- Distance measurement - Jaccard distance
- Web version 3D visualization tool, 97 things programmers should know, AI frontier paper | information daily # 2022.07.01
- AI开发调试系列第二弹:多机分布式调测探索之旅
- How to delete the border of links in IE? [repeat] - how to remove borders around links in IE? [duplicate]
猜你喜欢

UML 类图

深度学习数学基础

Comprendre complètement le tutoriel de traitement de Point Cloud basé sur open3d!

MySQL advanced learning summary 8: overview of InnoDB data storage structure page, internal structure of page, row format

Industrial software lecture - core technology analysis of 3D CAD design software - the second lecture of the Forum

故障排查:kubectl报错ValidationError: unknown field \u00a0

STM32G0 USB DFU 升级校验出错-2

新加坡暑假旅游攻略:一天玩转新加坡圣淘沙岛

LightGroupButton* sender = static_cast<LightGroupButton*>(QObject::sender());

Novice must see, click two buttons to switch to different content
随机推荐
Stratégie touristique d'été de Singapour: un jour pour visiter l'île de San taosha à Singapour
How can retail enterprises open the second growth curve under the full link digital transformation
页面标题组件
Imitation Jingdong magnifying glass effect (pink teacher version)
高频面试题
Excel查找一列中的相同值,删除该行或替换为空值
在Tensorflow2中使用mnist_784数据集进行手写数字识别
R语言dplyr包filter函数筛选dataframe数据、如果需要筛选的数据列(变量)名称中包含引号则需要使用!!sym语法处理、否则因为无法处理引号筛选不到任何数据
LightGroupButton* sender = static_cast<LightGroupButton*>(QObject::sender());
LightGroupButton* sender = static_ cast<LightGroupButton*>(QObject::sender());
[daily question] first day
How to write controller layer code gracefully?
Hongmeng's fourth learning
Eliminate the yellow alarm light on IBM p750 small computer [easy to understand]
[论文阅读] CA-Net: Leveraging Contextual Features for Lung Cancer Prediction
【JVM调优实战100例】01——JVM的介绍与程序计数器
新加坡暑假旅遊攻略:一天玩轉新加坡聖淘沙島
Leetcode (81) -- search rotation sort array II
The difference between promise and observable
SLC、MLC、TLC 和 QLC NAND SSD 之间的区别:哪个更好?