dcsimg
Login | Register   
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


advertisement
 

Use Conditional Compilation to Hide Platform Dependencies and Implement #include Guards

Though many languages have long since disposed of their preprocessors, in C++ it is still an indispensable tool for source file management and cross-platform development. This solution shows how you can use the preprocessor to perform conditional compilation.


advertisement

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


he C++ preprocessor may seem like a prehistoric relic that has no place in state-of-the-art C++ projects, but this isn't really so. Although every beginner nowadays knows how to use inline functions and const variables instead of #define macros, the preprocessor is still an indispensable tool when it comes to source file management and cross-platform development.


How can you avoid multiple inclusions of the same header file during a compilation session? How can you overcome platform-dependencies in a large-scale project?


Use the preprocessor to perform conditional compilation.



Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date