Lecture 2 - Page 39 : 42
Notes about C++
Basic facilities
Basic facilities
Fundamental types i C++
Booleans
Structs in C++
Declarations and definitions
The structure of a declaration
Declaring several names together
Declarations as statements - declarations in conditions
Constants
The general notation of objects in C++
Lvalues
C-style strings
C++ style strings
Strings - examples
References
Rules for references
References - Examples
Constant References
References versus Pointers
Parameter passing in C++
Value return
Type conversion - Grand Overview
Implicit type conversions
Explicit type conversion
Function Overloading
Function Overloading - more detailed rules
Function Overloading - Examples
Vectors in C++
Vectors - examples
The free store
Input and output in C++
Overloaded operators and IO
Standard streams
Stream State
Manipulators
More manipulators
Logical program organization
More namespaces
Physical program organization
Example of program organization
The standard library namespace
Point Exercise - C++ versus C#
Physical program organization
The physical program organization is done by means of source files
The C++ Programming Language
: Page 197 - ...
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
files
The
.cpp
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++ Programming Language
: Page 199: External and internal linkage