Google
 
Webcprogramming.com




An Affiliate of AIHorizon




#ifdef

#ifdef <token>
/* code */
#else
/* code to include if the token is not defined */
#endif
ifdef checks whether the given token has been #defined earlier in the file or in an included file. If so, it includes everything between it and the closing #else or, if no #else is present, the closing #endif. #ifdef can be used with built-in token identifiers set by the compiler to indicate that additional functionality is available. For instance, the __cplusplus macro is defined in C++ but not C; you can use this fact to mix C and C++ code using an #ifdef statement:
#ifdef __cplusplus
// C++ code
#else
// C code
#endif

-----
Interested in advertising with us?
Please read our privacy policy.
Copyright © 1997-2005 Cprogramming.com. All rights reserved.

Geodesy Designs