previous |
start |
next
Separate Compilation
- When your code gets large or you work in a
team, you will want to split your code into separate source
files.
- Saves time: instead of recompiling the entire
program, only recompile files that have been changed.
- Group work: separate programmers work on
separate files.
- The header file (e.g.
Product.h) contains:
- definitions of constants
- definitions of classes
- declarations of nonmember functions
- declarations of global variables
- The source file (e.g. Product.cpp)
contains
- definitions of member functions
- definitions of nonmember functions
- definitions of global variables
previous |
start |
next