不会用就直接复制粘贴

#define CURSOR(top,bottom) (((top)<<8)|(bottom))
#define mul(x1,x2) (x1*x2)
#define WIDTH 8
#define LENGTH (WIDTH+10) /**
*
* check is c++ compiler
*/
#if !defined(__cplusplus)
#error c++ compiler requires
#endif #if defined(CLANG)//if defined CLANG use below code
void compiler()
{
std::cout<<"use clang"<<std::endl;
}
#elif defined(GUNC)
void compiler()
{
std::cout<<"use gunc++"<<std::endl;
}
#else
void compiler()
{
std::cout<<"unknown compiler"<<std::endl;
}
#endif #define DLEVEL 5 #if DLEVEL > 5
#define SIGNAL 1
#if STACKUSE == 1
#define STACK 200
#else
#define STACK 100
#endif
#else
#define SIGNAL 0
#if STACKUSE == 1
#define LEVEL 1
#define STACK 100
#else
#define STACK 50
#endif
#endif
#if LEVEL == 0
#define STACK 0
#elif DELEVEL == 1
#define STACK 100
#elif DLEVEL > 5
display(debugptr);
#else
#define STACK 200
#endif /* EXAMPLE.H - Example header file*/
#if !defined(EXAMPLE_H)
#define EXAMPLE_H
class Example
{ };
#endif /**
*
*Visual Studio 2017 version 15.3 and later,检查库头文件是否包含
*/
#
#ifdef _has_include
# if _has_include(<filesystem>)
# inculde <filesystem>
# define have_filesystem
# elif _has_include(<experimental/filesystem>)
# include <experimental/filesystem>
# define have_filesystem
# define experimental_filesystem
# else
# define have_filesystem
# endif
#endif #ifndef test
#define final
#endif //has no effect
# //stringizing 操作符转换宏指令参数成字符串字面量.
//比如下面这句 "This: \" prints an escaped double quote"
#define stringer(x) printf(#x "\n") #define F int
#define B def
#define FB(arg) #arg
#define FB1(arg) FB(arg)

C++ #define #if #ifndef 宏指令的更多相关文章

  1. C/C++预处理指令#define,#ifdef,#ifndef,#endif… (转)

    本文转自博文C/C++预处理指令#define,#ifdef,#ifndef,#endif….这篇博文写得特别好,特转载. 本文主要记录了C/C++预处理指令,常见的预处理指令如下: #空指令,无任何 ...

  2. C/C++预处理指令#define,#ifdef,#ifndef,#endif…

    2016年12月29日更新: 今天查看以前文件的时候, 突然发现了#error 这个预处理指令.然后回想一下工作, 发现这个指令使用场景还是很多的.比如: 一个项目的模块儿之多,源文件之大,代码之多, ...

  3. C++ #if #endif #define #ifdef #ifndef #if defined #if !defined详解 (转)

    (源)http://blog.csdn.net/sky1203850702/article/details/42024673 首先,让我们先从头文件开始,在很多头文件里,我们会看到这样的语句 #ifn ...

  4. c语言中的#ifdef和#ifndef

    #include "stdio.h"#include "conio.h"#define MAX#define MAXIMUM(x,y) (x>y)?x:y ...

  5. 2014.3.11-C语言学习小结

    文件操作: 知识点: 持久化 1.文本文件的读写 2.二进制文件的读写 3.缓冲文件系统 1.打开文件 2.读写文件 3.保存 4.关闭文件 ============================= ...

  6. dll导入导出宏定义,出现“不允许 dllimport 函数 的定义”的问题分析

    建立dll项目后,在头文件中,定义API宏 #ifndef API_S_H #define API_S_H ...... #ifndef DLL_S_20160424 #define API _dec ...

  7. SQLite源程序分析之sqlite3.c

    /****************************************************************************** ** This file is an a ...

  8. c/c++头文件_string

    string, cstring, string.h 一.string头文件 主要包含一些字符串转换的函数 // sto* NARROW CONVERSIONS// sto* WIDE CONVERSI ...

  9. 【VC++技术杂谈007】使用GDI+进行图片格式转换

    本文主要介绍如何使用GDI+对图片进行格式转换,可以转换的图片格式为bmp.jpg.png. 1.加载GDI+库 GDI+是GDI图形库的一个增强版本,提供了一系列Visual C++ API.为了使 ...

随机推荐

  1. jmeter接口测试基础知识1.0

    jmeter:性能测试工具,压测测试计划右键--添加--Threads(Users)--线程组(线程数就是并发数)--右键线程组--添加--Sampler--HTTP请求--最上面的名称可以修改,就是 ...

  2. 测试同学必备抓包工具--charles之mock数据

    charles中有三个是我经常用到来mock数据的. 一. 打断点--Breakpoints 1. 先切换查看‘Structure’模式 2. 找到目标链接,对其父级进行打断点,如图 3. 取消掉再次 ...

  3. [Go back to REDIS]

    Overview 内存中的数据结构存储系统,可以用作数据库.缓存和消息中间件. redis底层数据结构:跳跃表 [为什么选skiplist而不是red-black tree] 支持多种数据结构:Str ...

  4. js获取table中的列的数字的和

    function getTdValue(a) { var tableId = document.getElementById("tab"); var num; for(var i= ...

  5. VS Code 工具配置和格式化

    { "onSave": true, "javascript": { "indent_size": 2, "indent_char& ...

  6. TensorFlow安装教程---windows8.1

    首先,第一个,下载,python3.6.4版本 64位 安装python,由于,我是window8.1,所以我遇到这样的问题 参考解决方案:https://answers.microsoft.com/ ...

  7. python中类的创建和实例化

    python中同样使用关键字class创建一个类,类名称第一个字母大写,可以带括号也可以不带括号: python中实例化类不需要使用关键字new(也没有这个关键字),类的实例化类似函数调用方式: # ...

  8. 【转载】 强化学习(九)Deep Q-Learning进阶之Nature DQN

    原文地址: https://www.cnblogs.com/pinard/p/9756075.html ------------------------------------------------ ...

  9. Python全栈之路----Python2与Python3

    金角大王Alex  python 之路,致那些年,我们依然没搞明白的编码 python2与python3的区别 py2 str = bytes 为什么有bytes? 是因为要表示图片.视频等二进制格式 ...

  10. Linux下查看CPU型号,内存大小,硬盘空间的命令(详解)

    1 查看CPU 1.1 查看CPU个数 # cat /proc/cpuinfo | grep "physical id" | uniq | wc -l 2 **uniq命令:删除重 ...