不会用就直接复制粘贴

#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. Eclipse ee项目 Java Resources文件报错解决方法

    通常是JDK版本配置问题,这里使用的是JDK1.8版本 确保jre版本为本机配置的版本 打开Navigator目录的.settings文件夹修改org.eclipse.wst.common.compo ...

  2. mongoose的关联查询 :populate

    mongoose关联查询从3.2版本开始支持 基本用法如下: var studentSchema = new Schema({ name:String, age:String, school:{ ty ...

  3. python笔记12-字典

    1.定义字典#定义字典--字典里面的key是不能重复的info = { 'name':'xiaoming', 'sex':'nan', 'age':20, 'id':1,}2.字典取值 #取值:方法1 ...

  4. 1093 字符串A+B

    给定两个字符串 A 和 B,本题要求你输出 A+B,即两个字符串的并集.要求先输出 A,再输出 B,但重复的字符必须被剔除. 输入格式: 输入在两行中分别给出 A 和 B,均为长度不超过 10​6​​ ...

  5. Sql语句内功心法

    CREATE SCHEMA <模式名> AUTHORIZATION <用户名> 定义模式实际上定义了一个命名空间,在这个空间可以进一步定义该模式包含的数据库对象,例如基本表,视 ...

  6. vue-cli 安装过程出现错误

    如果是这样得错误,那是你在安装sass得问题,需要安装python2,安装好就行了

  7. python day19--面向对象,接口,封装

    #1.接口类,对象类.规范类中方法的统一. # 第一版:三个类,每个类中有相同的方法 # class Alipay: # def __init__(self,money): # self.money= ...

  8. [转]C++11常用特性的使用经验总结

    转载出处 http://www.cnblogs.com/feng-sc C++11已经出来很久了,网上也早有很多优秀的C++11新特性的总结文章,在编写本博客之前,博主在工作和学习中学到的关于C++1 ...

  9. Js/对数组的认识。

    1.是对数组的声明:   var auditTaskIds = []; 我一般的写法.   var auditTaskIds1 = [];  2.向数组中添加元素:   auditTaskIds.pu ...

  10. export 和import使用

    在JavaScript ES6中,export与export default均可用于导出常量.函数.文件.模块等,你可以在其它文件或模块中通过import+(常量 | 函数 | 文件 | 模块)名的方 ...