464 Appendix A C Language Summary
causes the code between the #ifand #endifto be processed if the identifier DEBUGhas
been previously defined (see Section 9.2.4).The parentheses are not necessary around
the identifier, so
#if defined DEBUG
works just as well.
9.2.4 The #ifdef Directive
The general format for declaring the #ifdefdirective is as follows:
#ifdef identifier
...
#endif
If the value of identifierhas been previously defined (either through a #defineor
with the -Dcommand-line option when the program was compiled), all program lines
up until the #endifare processed; otherwise, they are skipped. As with the #ifdirective,
#elifand #elsedirectives can be used with a #ifdefdirective.
9.2.5 The #ifndefDirective
The general format for declaring the #ifndefdirective is as follows:
#ifndef identifier
...
#endif
If the value of identifierhas not been previously defined, all program lines up until
the #endifare processed; otherwise, they are skipped. As with the #ifdirective,#elif
and #elsedirectives can be used with a #ifndefdirective.
9.2.6 The #include Directive
One general format for declaring the #includedirective is as follows:
#include "fileName"
The preprocessor searches an implementation-defined directory or directories first for
the file fileName.Typically, the same directory that contains the source file is searched
first. If the file is not found there, a sequence of implementation-defined standard places
is searched. After it is found, the contents of the file is included in the program at the
precise point that the #includedirective appears. Preprocessor directives contained
within the included file are analyzed, and, therefore, an included file can itself contain
other #includedirectives.
Another general format for declaring the #includedirective is as follows:
#include <fileName>
The preprocessor searches for the specified file only in the standard places.The action
taken after the file is found is otherwise identical to that described previously.
20 0672326663 AppA 6/10/04 2:01 PM Page 464