#define TRUE 1#define FALSE 0//...intdone=0;while(done!=TRUE){//...} Eine andere Eigenschaft des #define-Befehls ist, dass er Argumente entgegennehmen kann, sodass man mit ihm Pseudo-Funktionen erstellen kann.
Definitionsaredeclarationsthat fully define the entity introduced by the declaration. Every declaration is a definition, except for the following: A function declaration without a function body: intf(int);// declares, but does not define f
#ifndef FOO_H_INCLUDED /* 任何唯一地映射到文件名的名称 */#define FOO_H_INCLUDED// 文件内容在此#endif 许多编译器也会实现有类似效果的非标准语用#pragma once:在已经包含相同文件(文件的身份以操作系统指定的方式确定)的时候禁止处理该文件。
Defined in header <complex.h> #define I /* unspecified */ (since C99) The I macro expands to either _Complex_I or _Imaginary_I. If the implementation does not support imaginary types, then the macro always expands to _Complex_I. A program may undefine and perhaps then redefine the...
#include <iostream>// uncomment to disable assert()// #define NDEBUG#include <cassert>// Use (void) to silence unused warnings.#define assertm(exp, msg) assert((void(msg), exp))intmain(){assert(2+2==4);std::cout<<"Checkpoint #1\n";assert((void("void helps to avoid 'unused val...
#define debug(x) cout<<#x<<": "<<(x)<<endl;bool test(string s,int base=0) { size_t pos = 3; cout << s << ": " << stoi(s,&pos, base) << endl; debug(pos) debug(s.substr(pos)) return true;}int main() { // 若 base 为 0 ,则自动检测数值进制 test("0x1azzzz"...
#undef ElemType #undef FuncName #define FuncName add_int #define ElemType int #include "pre_processing.h" printf("1 + 2 = %d\n", add_int(1, 2)); #undef ElemType #undef FuncName #define FuncName add_double #define ElemType double #include "pre_processing.h" printf("1 + 2 = %....
ostream& produce_prefix(ostream& o, my_class mc) { for (register int i=mc.ctr; i; --i) o<<mc.c ; o<<mc.s1; return o; } IOMANIPdeclare(my_class); // define a manipulator for the class my_class OMANIP(my_class) pre_print(my_class mc) { ...
md5.cpp File ReferenceDefine DocumentationFunction Documentation
ClassHierarchy.cpp File ReferenceDefine DocumentationVariable Documentation