Section 1 : Introducing C++
1
Introducing C++
Section 2 : Moving from C to C++
2
C and C++ - similar in some ways but actually very different
3
C vs C++: Comments are different - and oh C++ has namespaces! Preview
4
Namespaces? Then we need a scope resolution operator
5
Not just function overloading C++ allows operator overloading as well! Preview
6
Default Values
7
References Const and Bool
Section 3 : Objects and Classes
8
Classes mean different things to different people! Preview
9
Classes - A logical grouping of data and functions
10
Example 1 and 2: Define a really simple C++ class and instantiate it
11
Example 3: Invoke the member functions of an object
12
Example 4 and 5: Setup and clean up using constructors and destructors Preview
13
Example 6: Access Modifiers
Section 4 : Multi-file Programs
14
Example 7: Separating code into .cpp and h files Preview
15
Example 7: Setting up dependencies with multiple files
Section 5 : Dynamic Memory Allocation: new and delete
16
Dynamic Memory Allocation Preview
17
C++ memory allocation explained
18
Stop using malloc and free
19
Do not mix new/delete for single variables with array equivalents new[]/delete[] Preview
20
Example 8 and 9: Stop using malloc and free use new and delete instead!
21
Example 10 and 11: Use new and delete for arrays - never mix new and new Preview
22
Example 12: The Placement new operator and the this pointer
Section 6 : The C++ string Class
23
The C++ string class
24
Example 14: Strings Preview
25
Example 15: Inputing multiline strings
26
Example 16: More common string operations Preview
27
Example 17: Comparing strings
28
Example 18: Converting C++ to C strings (and vice versa)
Section 7 : References
29
The basic idea of references
30
Example 19 20 and 21: A simple reference a const reference and C++ swap
31
Example 22 23 24 25: Reference initialization reassignment aliasing null
32
Example 26 27 28 29: References to pointers references as return types
Section 8 : The const Keyword
33
Example 30 and 31: The C++ const keyword
34
Example 32: const char or char const?
35
Example 33 34 35 36: Const methods mutable overloading on const const_cast
36
Passing function parameters const references
37
Example 37: Passing function parameters const references
Section 9 : The static Keyword
38
The basic idea of static in C++
39
Example 38: Static member variables
40
Example 39 and 40: Static member functions
41
Example 41: const static member variables
Section 10 : The friend Keyword
42
The basic idea of friends in C++
43
Example 42: Friend functions
44
Example 43: Friend classes
Section 11 : Operator Overloading
45
Understanding operator overloading - internal and external operators
46
Choosing between internal and external implementations
47
Example 44: Overloading the += operator
48
Example 45: Overloading the + operator
49
Example 46: Overloading the ++ (and --) operators
50
Example 47: Overloading the assignment operator
51
Operator Overloading - Streams Flashback
52
Example 48: Overloading the << and >> operators
Section 12 : Inheritance
53
Understanding inheritance - Flashback to objects and classes
54
Example 49 Understanding Inheritance
55
Inheritance Explained - I
56
Inheritance Explained - II
57
Example 49: Access levels and inheritance types
58
Example 49: Bringing all inheritance concepts together in code
59
Examples 50 51 52: Types of inheritance
60
Example 53: virtual functions
61
Example 53 (continued)
62
Example 54: pure virtual functions and abstract classes
63
Example 55: Multiple Inheritance and a Diamond Hierarchy
64
Example 56: Virtual inheritance in a Diamond Hierarchy
65
Example 57: Object Slicing
66
Example 58: No virtual function calls in constructors or destructors!
67
Example 59: Virtual destructors rock!
68
Example 60: Why virtual functions should never have default parameters
69
Example 61: The strange phenomenon of name hiding
70
Example 62: Never redefine non-virtual base class methods
Section 13 : Templates
71
Templates as a form of generic programming
72
Example 63: A simple template function
73
Example 64: Overriding a default template instantiation
74
Example 65: A templated smart pointer class
75
Example 66: Template Specialisation (partial or total)
Section 14 : STL - The Standard Template Library
76
Introducing the Standard Template Library
77
Example 67: The STL vector
78
Example 68: Iterators
79
Example 69: map an associative container
80
Example 70: STL algorithms
Section 15 : C++ Casts
81
C++ casts are way cooler than C casts
82
Example 71: const_cast
83
Example 72: dynamic_cast and RTTI
84
Example 73: static_cast and the explicit keyword
Section 16 : Exceptions
85
Exception handling and burglar alarms
86
Example 74: Throwing exceptions
87
Example 75: Handling exceptions with try/catch