DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

(cpp.info) Conditionals

Info Catalog (cpp.info) Macros (cpp.info) Top (cpp.info) Combining Sources
 
 Conditionals
 ============
 
    In a macro processor, a "conditional" is a directive that allows a
 part of the program to be ignored during compilation, on some
 conditions.  In the C preprocessor, a conditional can test either an
 arithmetic expression or whether a name is defined as a macro.
 
    A conditional in the C preprocessor resembles in some ways an `if'
 statement in C, but it is important to understand the difference between
 them.  The condition in an `if' statement is tested during the execution
 of your program.  Its purpose is to allow your program to behave
 differently from run to run, depending on the data it is operating on.
 The condition in a preprocessing conditional directive is tested when
 your program is compiled.  Its purpose is to allow different code to be
 included in the program depending on the situation at the time of
 compilation.
 

Menu

 
* Uses Conditional Uses.       What conditionals are for.
* Syntax Conditional Syntax.   How conditionals are written.
* Deletion Deleted Code.       Making code into a comment.
* Macros Conditionals-Macros.  Why conditionals are used with macros.
* Assertions                  How and why to use assertions.
* Errors #error Directive.     Detecting inconsistent compilation parameters.
 
Info Catalog (cpp.info) Macros (cpp.info) Top (cpp.info) Combining Sources
automatically generated byinfo2html