#if

The general form for this directive is:

    #if restricted_constant_expression

where restricted_constant_expression cannot contain: type casts, or enumeration constants. However they may contain the preprocessor defined(identifier) operator. The following:

	#if defined(identifier)

is identical to:

	#ifdef identifier

but with the advantage that the #elif directive (see below) can be used after it.

If restricted_constant_expression is evaluated, and if it has a value of true (non 0), then any lines which follow this directive will be given to the compiler up to the properly nested #else directive or #endif directive.


© 1991-2008 Prem Sobel. All Rights Reserved.