www.delorie.com/gnu/docs/gcc/cpp_40.html   search  
 
Buy the book!


The C Preprocessor

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.2.4 Else

The `#else' directive can be added to a conditional to provide alternative text to be used if the condition fails. This is what it looks like:

 
#if expression
text-if-true
#else /* Not expression */
text-if-false
#endif /* Not expression */

If expression is nonzero, the text-if-true is included and the text-if-false is skipped. If expression is zero, the opposite happens.

You can use `#else' with `#ifdef' and `#ifndef', too.


  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003