当前位置:网站首页>预处理和预处理宏
预处理和预处理宏
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");
}
边栏推荐
猜你喜欢

开源物联网平台ThingsBoard的安装

UML 类图

Installation of thingsboard, an open source IOT platform

第一次去曼谷旅游怎么玩?这份省钱攻略请收好

Singapore summer tourism strategy: play Singapore Sentosa Island in one day

材质UV遮罩的技巧

Imitation Jingdong magnifying glass effect (pink teacher version)

Google's official response: we have not given up tensorflow and will develop side by side with Jax in the future

鸿蒙第四次学习

谷歌官方回应:我们没有放弃TensorFlow,未来与JAX并肩发展
随机推荐
How to set vscode to delete the whole line shortcut key?
R语言ggplot2可视化分面图(facet):gganimate包基于transition_time函数创建动态散点图动画(gif)
Industrial software lecture - core technology analysis of 3D CAD design software - the second lecture of the Forum
论文导读 | 关于将预训练语言模型作为知识库的分析与批评
options should NOT have additional properties
Obligatoire pour les débutants, cliquez sur deux boutons pour passer à un contenu différent
How to delete the border of links in IE? [repeat] - how to remove borders around links in IE? [duplicate]
Distance measurement - Jaccard distance
Mini Golf Course: a good place for leisure and tourism in London
Kubernetes three open interfaces first sight
[100 cases of JVM tuning practice] 01 - introduction of JVM and program counter
Thoroughly understand the point cloud processing tutorial based on open3d!
论文导读 | 机器学习在数据库基数估计中的应用
9D电影是怎样的?(+维度空间常识)
Ali was wildly asked by the interviewer on three sides. Redis dared not write 'proficient' on his resume anymore
学生抖音宣传母校被吐槽“招生减章”,网友:哈哈哈哈哈哈
AI开发调试系列第二弹:多机分布式调测探索之旅
Looking for innocence in New York -- a beautiful day at the discovery center of Legoland, New Jersey
Progress-进度条
新手必看,点击两个按钮切换至不同的内容