O'Reilly logo

An Introduction to Design Patterns in C++ with Qt 4 by Paul Ezust, Alan Ezust

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix C. The Development Environment

The Preprocessor: For #including Files

This appendix explains some of the mysteries of the C preprocessor, class declarations versus including headers, and some best practices to reduce dependencies between header files.

In C++, code reuse is indicated by the presence of a preprocessor directive, #include, in source code and header files. We #include header files that contain things like class or namespace definitions, const definitions, function prototypes, and so forth. These files are literally included in our own files before the compiler begins to translate our code.

The compiler will report an error if it sees any identifier defined more than once. It will tolerate repeated declarations but not repeated ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required