Chapter 1 - Program
What is a definition?
What is a program?
What is a source file?
Program text
Comment
Name
The smallest legal C++ program
Exercise
Chapter 2 - Type
What is a type?
The type: char
The type: int
The type: float
The type: string
Truth in C++
iostream.h
"get.h"
"string.h"
endl
Combining output to the screen
Usage
Exercise
Chapter 3 - Operator
Operator
Expression
Order of evaluation of operators
Exercise
Chapter 4 - Statement
Statement
Definition Statement
Expression Statement
Compound Statement
If Statement
Logical Operators
Loop
While Statement
For Statement
Exercise
Chapter 5 - Array
Array
Array Definition
Array Subscripting
How to copy an array
Exercise
Chapter 6 - Pointer
Address
How to get the address of a variable
Pointer
How to define a pointer
How to set a pointer
How to dereference a pointer
Exercise
Chapter 7 - Reference
Reference
How to define a reference
Pointers and References
Exercise
Chapter 8 - Const
How to make something read-only
Pointer to read-only
Reference to read-only
Exercise
Chapter 9 - Scope
Scope
Example
Chapter 10 - Function
Function
Function definition
Function call
How to pass one input parameter to a function
How to pass two input parameters to a function
How to pass an output parameter from a function
Function scope
Pass-by-value input parameters
Pass-by-pointer input parameters
Pass-by-reference input parameters
Pass-by-const-reference input parameters
Exercise
Chapter 11 - Overloaded function
Overloaded function
Overloading
Which overload to invoke?
Exercise
Chapter 12 - Header file
Multiple source files
Scope
What is a declaration?
What is a header file?
How to declare a function
#include
Sample
Exercise
Chapter 13 - Class
Class in UML
Class in C++
How to use a class
Exercise
Chapter 14 - Attribute
Attribute in UML
Attribute in C++
Exercise
Chapter 15 - Operation
Operation in UML
Operation in C++
Function member definitions
How to use an operation (i.e. send a message)
How to use an operation (i.e. send a message) via a pointer
How to use an operation (i.e. send a message) via a reference
Const function member
Exercise
Chapter 16 - Object I/O
How to output an object to the screen
How to use object output
How to input an object from the keyboard
How to use object input
Exercise
Chapter 17 - Constructor
Object initialization
Problems
Object initialization (again)
Problems (again)
Object initialization (finally)
Constructor
How to initialize via copying from an existing object of the same class
Copy constructor
Exercise
Chapter 19 - How to add an attribute to a class
Exercise
Chapter 20 - 1-1 Association
1-1 Association in UML
1-1 Association in C++
Exercise
Chapter 21 - 1-Optional Association
1-Optional Association in UML
1-Optional Association in C++
Exercise
Chapter 22 - 1-Many Association
1-Many Association in UML
1-Many Association in C++
Exercise
Chapter 23 - Aggregation
Aggregation in UML
Aggregation in C++
Notes
Exercise
Chapter 24 - Inheritance
Inheritance in UML
Inheritance in C++
Notes
Exercise
Chapter 25 - Overriding
Overriding
Derived class's implementation does no work
Derived class's implementation does less work
Derived class's implementation does more work
Exercise
Chapter 27 - Polymorphism
Polymorphism in UML
Polymorphism in C++
How to make an operation polymorphic in C++
Notes
Exercise
Chapter 28 - Abstract Class
Abstract class in UML
Abstract class
How to make a polymorphic operation abstract in C++
Exercise
Chapter 29 - Overloaded Operator
What we have now
Wouldn't it be nice ...
Overloaded operator
How to overload an operator
Overriding an overloaded operator
Exercise
Chapter 30 - Stream
Stream
<< and >>
Overloading << and >>
Exercise
Chapter 31 - File I/O
How to output to a disk file
How to input from a disk file
How to test for end of file
Exercise