The C Preprocessor - Macros

Node: Macros Next: Conditionals Prev: Header Files Up: Top

Macros

A macro is a sort of abbreviation which you can define once and then use later. There are many complicated features associated with macros in the C preprocessor.

Simple Macros Macros that always expand the same way.
Argument Macros Macros that accept arguments that are substituted
into the macro expansion.
Predefined Predefined macros that are always available.
Stringification Macro arguments converted into string constants.
Concatenation Building tokens from parts taken from macro arguments.
Undefining Cancelling a macro's definition.
Redefining Changing a macro's definition.
Macro Pitfalls Macros can confuse the unwary. Here we explain
several common problems and strange features.


Next: Conditionals Up: Top