15. Source Files and Programs
Form must follow function.
– Le Corbusier
• Separate Compilation
File-Local Names; Header Files; The One-Definition Rule; Standard-Library Headers; Linkage to Non-C++ Code; Linkage and Pointers to Functions
• Using Header Files
Single-Header Organization; Multiple-Header Organization; Include Guards
Initialization of Nonlocal Variables; Initialization and Concurrency; Program Termination
15.1. Separate Compilation
Any realistic program consists of many logically separate components (e.g., namespaces; Chapter 14). To better manage these components, we can represent the program as a set of (source code) files where each file contains one or more logical components. Our task is to devise ...