December 2013
Beginner
576 pages
16h 4m
English
The #if preprocessor statement offers a more general way of controlling conditional compilation. The #if statement can be used to test whether a constant expression evaluates to nonzero. If the result of the expression is nonzero, subsequent lines up to a #else, #elif, or #endif are processed; otherwise, they are skipped.
As an example of how this can be used, the following lines appear in the Foundation header file NSString.h:
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5#define NSMaximumStringLength (INT_MAX-1)#endif
This tests the value of the defined variable MAC_OS_X_VERSION_MIN_REQUIRED against the defined variable MAC_OS_X_VERSION_10_5. If the former ...
Read now
Unlock full access