Lecture 3 - Slide 25 : 27
Physical program organization
The physical program organization is done by means of source files
The C++ Prog. Lang. (3. edition)
:
Page 197ff.
The C++ Prog. Lang. (4. edition)
: Page 419ff.
Source file organization of C++ programs
Source files with
#include
directives
A
translation units
is the result of preprocessing a
source file
.h
files and
.cpp
or
.cc
files
The
.cpp
or
.cc
file includes its
.h
file.
Separate compilation - and subsequent linking
External linkage:
A name that can be used in other translation units than the one where it is defined
Internal linkage
A name that only can be used in the translation unit where it is defined
Declared as
static
in C programs and older C++ programs
Use an unnamed namespace for internal linkage in C++ programs
The C++ Prog. Lang. (3. edition)
:
External and internal linkage. Page 199
The C++ Prog. Lang. (4. edition)
: Linkage. Page 420