Micron Document
The C Programming Language, Ansi C


← Prev · 102/277 · Next →

This sequence tests the name SYSTEM to decide which version of a header to include:

#define HDR "sysv.h"
#elif SYSTEM == BSD
#define HDR "bsd.h"
#elif SYSTEM == MSDOS
#define HDR "msdos.h"
#else
#define HDR "default.h"
#endif
#include HDR

The


and


lines are specialized forms that test
whether a name is defined. The first example of


above could have
been written

#define HDR

/* contents of hdr.h go here */

#endif




Compiled by tmdcjsl(skidrow8123@hotmail.com)