Directive #define


Directive #define

#define

Description

This directive is used to define or redefine a cpp macro.

The simplest way to use define is to write

#define <identifier> <replacement string>

which will cause all subsequent occurances of <identifier to be replaced with the <replacement string>.

Define also has the capability to use arguments, thus a line like

#define <identifier>(arg1, arg2) <replacement string>

would cause <identifer> to be a macro. All occurances of '<identifier>(something1,something2d)' would be replaced with the <replacement string>. And in the <replacement string>, arg1 and arg2 will be replaced with something1 and something2.