-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmacros.cpp
More file actions
31 lines (27 loc) · 724 Bytes
/
macros.cpp
File metadata and controls
31 lines (27 loc) · 724 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
A macro is a piece of code in a program that is replaced by the value of the macro.
Macro is defined by #define directive. Whenever a macro name is encountered by the compiler,
it replaces the name with the definition of the macro. Macro definitions need not be terminated by a semi-colon(;).
1. Object-like Macros
#define DATE 31
2. Chain Macros
#define INSTAGRAM FOLLOWERS
#define FOLLOWERS 138
3. Multi-line Macros
#define ELE 1, \
2, \
3
4. Function-like Macro
#define min(a, b) (((a) < (b)) ? (a) : (b))
*/
#include <iostream>
#ifdef PR_DEBUG
#define LOG(x) std::cout << x << std::endl
#else
#define LOG(x)
#endif
int main()
{
LOG("Hello");
return 0;
}