Preprocessor command: #define
simple textual substitution e.g.
Before: -> After:
: :
#define EOF -1 :
: :
while (c != EOF) while (c != -1)
if (c == EOF) if (c == -1)
define macros
- Syntax: #define function(x) (expression involving (x))
Before
#define ABS(x) ((x) > 0) ? (x) : -(x))
:
After
y = ABS(m); y = ((m) > 0) ? (m):-(m));