| Preface |
|
xi | |
| Part I --- Start up! |
|
1 | (56) |
|
|
|
3 | (4) |
|
|
|
7 | (12) |
|
Variables, loops, conditional statements |
|
|
8 | (4) |
|
Variables under the microscope |
|
|
12 | (3) |
|
|
|
15 | (4) |
|
|
|
15 | (1) |
|
|
|
16 | (1) |
|
Passing parameters means copying |
|
|
17 | (2) |
|
Pointers and memory management |
|
|
19 | (16) |
|
The basic principle of the pointer |
|
|
20 | (1) |
|
Pointers as array variables |
|
|
21 | (1) |
|
Dynamically acquired memory |
|
|
22 | (4) |
|
|
|
26 | (2) |
|
Other properties of pointers |
|
|
28 | (4) |
|
|
|
28 | (2) |
|
|
|
30 | (1) |
|
|
|
31 | (1) |
|
The parameters of a program |
|
|
32 | (3) |
|
|
|
35 | (18) |
|
|
|
37 | (2) |
|
|
|
39 | (2) |
|
|
|
41 | (2) |
|
Separation of interface and implementation |
|
|
43 | (3) |
|
Dynamically created objects |
|
|
46 | (2) |
|
|
|
48 | (5) |
|
|
|
53 | (4) |
|
|
|
53 | (4) |
| Part II --- Take that! |
|
57 | (182) |
|
|
|
59 | (12) |
|
References instead of pointers |
|
|
59 | (1) |
|
References as method parameters |
|
|
60 | (11) |
|
|
|
60 | (2) |
|
References as passed parameters |
|
|
62 | (1) |
|
References as return values |
|
|
63 | (3) |
|
const in method signatures |
|
|
66 | (3) |
|
Combinations of const and references |
|
|
69 | (2) |
|
|
|
71 | (28) |
|
|
|
71 | (3) |
|
|
|
74 | (7) |
|
|
|
74 | (1) |
|
|
|
75 | (2) |
|
|
|
77 | (2) |
|
|
|
79 | (2) |
|
The inheritance of interfaces |
|
|
81 | (3) |
|
|
|
84 | (3) |
|
Protected and friend elements |
|
|
87 | (2) |
|
|
|
89 | (7) |
|
|
|
89 | (3) |
|
The diamond constellation |
|
|
92 | (2) |
|
|
|
94 | (2) |
|
|
|
96 | (3) |
|
|
|
99 | (38) |
|
Constructors and destructors |
|
|
99 | (5) |
|
|
|
99 | (4) |
|
|
|
103 | (1) |
|
Methods with a special function |
|
|
104 | (8) |
|
|
|
105 | (3) |
|
|
|
108 | (1) |
|
|
|
108 | (1) |
|
|
|
109 | (2) |
|
Preventing default implementation |
|
|
111 | (1) |
|
|
|
112 | (8) |
|
|
|
112 | (1) |
|
When do parameter lists differ? |
|
|
113 | (3) |
|
|
|
116 | (2) |
|
|
|
118 | (2) |
|
|
|
120 | (11) |
|
An addition operator for texts |
|
|
120 | (3) |
|
A global addition operator |
|
|
123 | (3) |
|
Other properties of operators |
|
|
126 | (1) |
|
A sideways look at operators |
|
|
127 | (3) |
|
Type conversion operators |
|
|
130 | (1) |
|
|
|
131 | (2) |
|
|
|
133 | (4) |
|
Advanced language elements |
|
|
137 | (26) |
|
|
|
137 | (9) |
|
|
|
137 | (1) |
|
|
|
138 | (1) |
|
Differentiating exceptions |
|
|
139 | (4) |
|
|
|
143 | (3) |
|
Static attribute and methods |
|
|
146 | (5) |
|
|
|
147 | (3) |
|
References to static objects |
|
|
150 | (1) |
|
|
|
151 | (12) |
|
|
|
151 | (2) |
|
|
|
153 | (1) |
|
|
|
154 | (3) |
|
|
|
157 | (1) |
|
Templates or interface inheritance? |
|
|
157 | (6) |
|
|
|
163 | (26) |
|
|
|
163 | (5) |
|
|
|
163 | (2) |
|
Multiple branches created by switch |
|
|
165 | (1) |
|
Enum as a clear sets of values |
|
|
166 | (2) |
|
|
|
168 | (6) |
|
A macro for debug outputs |
|
|
169 | (2) |
|
|
|
171 | (1) |
|
Conditional translation with macros |
|
|
172 | (2) |
|
Structs, namespaces, typedefs, unions |
|
|
174 | (5) |
|
|
|
174 | (1) |
|
|
|
175 | (2) |
|
|
|
177 | (1) |
|
|
|
178 | (1) |
|
|
|
179 | (10) |
|
Implicit conversion between basic types |
|
|
179 | (2) |
|
Explicit conversion between basic types |
|
|
181 | (2) |
|
Conversions between classes |
|
|
183 | (1) |
|
|
|
184 | (3) |
|
Old conversions with a new look |
|
|
187 | (2) |
|
|
|
189 | (16) |
|
|
|
189 | (3) |
|
|
|
192 | (3) |
|
Adding to reference strings |
|
|
192 | (1) |
|
|
|
193 | (1) |
|
|
|
194 | (1) |
|
|
|
195 | (2) |
|
|
|
197 | (1) |
|
|
|
198 | (2) |
|
Safe pointer administration |
|
|
200 | (1) |
|
|
|
201 | (4) |
|
|
|
205 | (18) |
|
Classes without attributes |
|
|
206 | (3) |
|
Methods with multiple parameters |
|
|
209 | (2) |
|
Methods with multiple return values |
|
|
211 | (3) |
|
|
|
214 | (2) |
|
|
|
216 | (3) |
|
|
|
219 | (4) |
|
|
|
223 | (10) |
|
Containers and algorithms |
|
|
224 | (4) |
|
|
|
224 | (1) |
|
|
|
225 | (1) |
|
|
|
226 | (2) |
|
|
|
228 | (1) |
|
|
|
229 | (1) |
|
|
|
230 | (1) |
|
|
|
230 | (3) |
|
|
|
233 | (6) |
|
|
|
234 | (1) |
|
|
|
235 | (1) |
|
|
|
236 | (3) |
| Part III --- Go ahead! |
|
239 | (38) |
|
|
|
241 | (10) |
|
|
|
241 | (2) |
|
|
|
241 | (1) |
|
|
|
242 | (1) |
|
|
|
243 | (2) |
|
|
|
245 | (6) |
|
|
|
247 | (1) |
|
|
|
248 | (1) |
|
Declaration and visibility |
|
|
248 | (1) |
|
|
|
249 | (2) |
|
|
|
251 | (6) |
|
|
|
257 | (4) |
|
|
|
257 | (1) |
|
|
|
257 | (1) |
|
|
|
258 | (3) |
|
|
|
261 | (10) |
|
|
|
262 | (3) |
|
|
|
265 | (6) |
|
Additional language elements |
|
|
271 | (4) |
|
|
|
271 | (1) |
|
|
|
271 | (2) |
|
|
|
273 | (1) |
|
|
|
273 | (1) |
|
|
|
274 | (1) |
|
Preprocessor instructions |
|
|
275 | (2) |
| A Code of the text class |
|
277 | (4) |
| Index |
|
281 | |