Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
#ifdef
◄Up► ◄Contents► ◄Index► ◄Back►
────────────────────────────────────────────────────────────────────────────
Directive: #ifdef
#if defined
Syntax: #ifdef identifier
#if defined (identifier)
Summary: Checks to see whether <identifier> is currently defined.
Returns true (nonzero) if it is currently defined, or
false (0) if it is not. The expression #if defined is
preferred for all new programs because it can be easily
changed to check for other conditions on the same line.
For example,
#ifdef OS2
#ifdef PM
#pragma message ("OS2 and PM defined")
#endif
#endif
#if defined OS2 && defined PM
#pragma message ("OS2 and PM defined")
#endif
See also: #define, defined, #if, #ifndef, #undef
-♦-