next up previous contents
Next: Header File Template Up: File Structure Previous: File Structure   Contents

Header File

In the day and age of hundreds and thousands of files in a project, quite often it becomes very difficult to remember who includes what header files. Without taking any precautions you will get many ``already defined'' errors. Prevent these errors by:


5#5

This sequence of preprocessor commands allows this header file to be included more than once in any particular implementation or header file without generating ``already defined'' errors.

You should also try to have only one class per header and implementation file. This greatly simplifies the compilation process as well as partitioning your source code into logical divisions. For extremely large class implementations (over several thousand lines) it would be reasonable to divide the implementation into more than one file.



Falko Kuester 2001-08-24