#define (directive)
Defines a macro
Syntax:
#define <id1>[ ( <id2>, ... ) ]
<token string>
The #define directive defines a macro.
Macros provide a mechanism for token replacement with or
without a set of
formal, function-line parameters.
All subsequent instances of the identifier <id1> in
the source text will be
replaced by the text defined by <token string>.
Example:
#define MAXINT 32767
#define ctrl(x) ((x)
\
- 64) /* continued
from preceding line */
It is legal but ill-advised to use Turbo C++ keywords as
macro identifiers.
For example,
#define int long
is legal, but possibly catastrophic.
0 comments:
Post a Comment