> if directives ~ Online tutorial

if directives

#if directive 
Conditional compilation directives
Syntax:
#if
#else
#endif

1)The compiler only compiles the lines that follow the #if directive when
evaluates to non-zero.
2)Otherwise, the compiler skips the lines that follow until it encounters the
matching #else or #endif.
3)If the expression evaluates to false and there is a matching #else, the
lines between the #else and the #endif are compiled.
4)#if directives can be nested, but matching #else and #endif directives must
be in the same file as the #if.

Example

#if defined(NEARPOINTERS)
space = farcoreleft();
#elif defined(FARPOINTERS)
space = coreleft();
#else
#error Unsupported memory model
#endif

Please Give Us Your 1 Minute In Sharing This Post!
Please Give Us Your 1 Minute In Sharing This Post!
SOCIALIZE IT →
FOLLOW US →
SHARE IT →
Powered By: BloggerYard.Com

0 comments: