C - Conditional Compilation

From EdWiki

Revision as of 09:30, 23 June 2015 by Jshankar (Talk | contribs) (1 revision imported: EdWiki -- Emsys pages from Shukra)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Conditional Compilation

  • It is possible to control preprocessing itself with conditional statements that are evaluated during preprocessing. This provides a way to code selectively, depending on the value of conditions evaluated during compilation.
  • The conditional statements are : #if, #elif, #else, #endif, #ifdef, #ifndef, and #defined
  • The #if line evaluates a constant integer expression. If the expression is non-zero, subsequent lines are included until an #endif or #elif or #else is encountered.
  • The #ifdef and #ifndef are specialized forms that test whether a name is defined.