C/C++ Programmer's Guide (G06.27+, H06.08+, J06.03+)

printf("Function prototypes not supported.\n");
#endif
2. This example shows how the #elif directive works. The #if, #elif, and #else directives
are used to make one of three choices, based on the value of XCOORD and YCOORD. Note
that XCOORD and YCOORD must be defined constants.
#define XCOORD 5
#define YCOORD 5
#if XCOORD == 10
printf("Intersection at (10,5).\n");
#elif YCOORD == 10
printf("Intersection at (5,10).\n");
#else
printf("Intersection at (5,5) \n");
#endif
3. This example shows how the #ifdef directive works. Because PC is defined as a macro, the
compiler processes the source text following the #ifdef PC directive. The compiler ignores
the source text following the #ifdef TNS directive because TNS is undefined:
#define PC 1
#ifdef TNS
/* HP Tandem dependent code. */
printf("This program executes on the server.\n");
#endif
#ifdef PC
/* pc dependent code. */
printf("This program executes on the pc.\n");
#endif
4. This example shows how the #ifndef directive works. Because TNS is not defined as a
macro, the compiler processes the source text following the #ifndef TNS directive. The
compiler ignores the source text following the #ifndef PC directive because PC is defined:
#define PC 1
#ifndef TNS
printf("TNS is not currently defined.\n");
#endif
#ifndef PC
printf("PC is not currently defined.\n");
#endif
#include
The #include directive includes source text from a specified file.
#include source_specifier [ nolist ] newline
source-specifier:
{ " source_file [ section_list ] " } |
{ < library_header_file [ section_list ] > }
section_list:
( section_name [ , section_name ]... )
source_specifier
specifies the location of the program text that the compiler includes in the compilation.
#include 157