Exforsys
+ Reply to Thread
Results 1 to 3 of 3

Use of the Directive

This is a discussion on Use of the Directive within the C and C++ forums, part of the Programming Talk category; What is the use of #if directives in C programming language. If someone could provide me the syntax and it ...

  1. #1
    rachelle is offline Member Array
    Join Date
    Apr 2006
    Answers
    97

    Exclamation Use of the Directive

    What is the use of #if directives in C programming language. If someone could provide me the syntax and it would help me a lot.


  2. #2
    Ralph is offline Senior Member Array
    Join Date
    Apr 2006
    Answers
    114
    The #if directive controls compilation of portions of a source file. If the expression you write after the #if have a nonzero value, the line group immediately following the #if directive is retained in the translation unit.


  3. #3
    Sandhya.Kishannag is offline Member Array
    Join Date
    Feb 2012
    Answers
    66
    The syntax of #if is #if constant-expression newline

    This directive checks whether the constant-expression is true (nonzero). The operand must be a constant integer expression that does not contain any increment (++), decrement (- -), sizeof , pointer (*), address (&), and cast operators. The constant expression in an #if directive is subject to text replacement and can contain references to identifiers defined in previous #define directives. The replacement occurs before the expression is evaluated.


    •    Sponsored Ads



Latest Article

Network Security Risk Assessment and Measurement

Read More...