What is Macro (#define)?
In C, a text replacement given a name with #define. There are object-like macros naming constants, as in #define BUF_SIZE 64, and function-like macros taking arguments, as in #define SQUARE(x) ((x) * (x)); the preprocessor expands them before compilation. Expansion is only text replacement, so without parentheses around the arguments and the whole body, operator precedence can produce an unintended expression, and an argument with side effects such as SQUARE(i++) is evaluated more than once.
Japanese name: マクロ
Macro (#define) appears in 3 practice questions across 1 topic, including C Programming Basics.
Field: C Programming Basics