Part I The Basics
Chapter 2 Hello, World! 43
(
>>18763) 2.2 The classic first program 45
(
>>18765) 2.3 Compilation 47
Chapter 3 Objects, Types, and Values 59
(
>>18766) 3.1 Input 60
(
>>18798) 3.2 Variables 62
(
>>18805) 3.3 Input and type 64
(
>>18813) 3.4 Operations and operators 66
(
>>18854) 3.5 Assignment and initialization 69
(
>>18856) 3.5.1 An example: detect repeated words 71
(
>>18857) 3.6 Composite assignment operators 73
(
>>18858) 3.6.1 An example: find repeated words 73
(
>>18859) 3.7 Names 74
(
>>18910) 3.8 Types and objects 77
(
>>18911) 3.9 Type safety 78
(
>>18913) 3.9.1 Safe conversions 79
(
>>18915) 3.9.2 Unsafe conversions 80
Chapter 4 Computation 89
(
>>18920) 4.3 Expressions 94
(
>>18922) 4.3.1 Constant expressions 95
(
>>18969) 4.3.2 Operators 97
(
>>18970) 4.3.3 Conversions 99
(
>>18994) 4.4 Statements 100
(
>>19044) 4.4.1.1 if-statements 102
(
>>19209) 4.4.1.2 switch-statements 105
(
>>19213) 4.4.1.3 Switch technicalities 106
(
>>19354) § 4.4.2.1 while-statements 109
(
>>19394) § 4.4.2.2 Blocks 111
(
>>19395) § 4.4.2.3 for-statements 111
(
>>00000) 4.5 Functions 113
(
>>00000) 4.5.1 Why bother with functions? 115
(
>>00000) 4.5.2 Function declarations 117
(
>>18746) 4.6 vector 117
(
>>00000) 4.6.1 Traversing a vector 119
(
>>00000) 4.6.2 Growing a vector 119
(
>>00000) 4.6.3 A numeric example 120
(
>>00000) 4.6.4 A text example 123
(
>>00000) 4.7 Language features 125
Chapter 5 Errors 133
(
>>00000) 5.1 Introduction 134
(
>>00000) 5.2 Sources of errors 136
(
>>00000) 5.3 Compile-time errors 136
(
>>00000) 5.3.1 Syntax errors 137
(
>>00000) 5.3.2 Type errors 138
(
>>00000) 5.3.3 Non-errors 139
(
>>00000) 5.4 Link-time errors 139
(
>>00000) 5.5 Run-time errors 140
(
>>00000) 5.5.1 The caller deals with errors 142
(
>>00000) 5.5.2 The callee deals with errors 143
(
>>00000) 5.5.3 Error reporting 145
(
>>00000) 5.6 Exceptions 146
(
>>00000) 5.6.1 Bad arguments 147
(
>>00000) 5.6.2 Range errors 148
(
>>00000) 5.6.3 Bad input 150
(
>>00000) 5.6.4 Narrowing errors 153
(
>>00000) 5.7 Logic errors 154
(
>>00000) 5.8 Estimation 157
(
>>00000) 5.9 Debugging 158
(
>>00000) 5.9.1 Practical debug advice 159
(
>>00000) 5.10 Pre- and post-conditions 163
(
>>00000) 5.10.1 Post-conditions 165
(
>>00000) 5.11 Testing 166
Chapter 6 Writing a Program 173
(
>>00000) 6.1 A problem 174
(
>>00000) 6.2 Thinking about the problem 175
(
>>00000) 6.2.1 Stages of development 176
(
>>00000) 6.2.2 Strategy 176
(
>>00000) 6.3 Back to the calculator! 178
(
>>00000) 6.3.1 First attempt 179
(
>>00000) 6.3.2 Tokens 181
(
>>00000) 6.3.3 Implementing tokens 183
(
>>00000) 6.3.4 Using tokens 185
(
>>00000) 6.3.5 Back to the drawing board 186
(
>>00000) 6.4 Grammars 188
(
>>00000) 6.4.1 A detour: English grammar 193
(
>>00000) 6.4.2 Writing a grammar 194
(
>>00000) 6.5 Turning a grammar into code 195
(
>>00000) 6.5.1 Implementing grammar rules 196
(
>>00000) 6.5.2 Expressions 197
(
>>00000) 6.5.3 Terms 200
(
>>00000) 6.5.4 Primary expressions 202
(
>>00000) 6.6 Trying the first version 203
(
>>00000) 6.7 Trying the second version 208
(
>>00000) 6.8 Token streams 209
(
>>00000) 6.8.1 Implementing Token_stream 211
(
>>00000) 6.8.2 Reading tokens 212
(
>>00000) 6.8.3 Reading numbers 214
(
>>00000) 6.9 Program structure 215
Chapter 7 Completing a Program 221
(
>>00000) 7.1 Introduction 222
(
>>00000) 7.2 Input and output 222
(
>>00000) 7.3 Error handling 224
(
>>00000) 7.4 Negative numbers 229
(
>>00000) 7.5 Remainder: % 230
(
>>00000) 7.6 Cleaning up the code 232
(
>>00000) 7.6.1 Symbolic constants 232
(
>>00000) 7.6.2 Use of functions 234
(
>>00000) 7.6.3 Code layout 235
(
>>00000) 7.6.4 Commenting 237
(
>>00000) 7.7 Recovering from errors 239
(
>>00000) 7.8 Variables 242
(
>>00000) 7.8.1 Variables and definitions 242
(
>>00000) 7.8.2 Introducing names 247
(
>>00000) 7.8.3 Predefined names 250
(
>>00000) 7.8.4 Are we there yet? 250
Chapter 8 Technicalities: Functions, etc. 255
(
>>00000) 8.1 Technicalities 256
(
>>00000) 8.2 Declarations and definitions 257
(
>>00000) 8.2.1 Kinds of declarations 261
(
>>00000) 8.2.2 Variable and constant declarations 262
(
>>00000) 8.2.3 Default initialization 263
(
>>00000) 8.3 Header files 264
(
>>00000) 8.4 Scope 266
(
>>00000) 8.5 Function call and return 272
(
>>00000) 8.5.1 Declaring arguments and return type 272
(
>>00000) 8.5.2 Returning a value 274
(
>>00000) 8.5.3 Pass-by-value 275
(
>>00000) 8.5.4 Pass-by-const-reference 276
(
>>00000) 8.5.5 Pass-by-reference 279
(
>>00000) 8.5.6 Pass-by-value vs. pass-by-reference 281
(
>>00000) 8.5.7 Argument checking and conversion 284
(
>>00000) 8.5.8 Function call implementation 285
(
>>00000) 8.5.9 constexpr functions 290
(
>>00000) 8.6 Order of evaluation 291
(
>>00000) 8.6.1 Expression evaluation 292
(
>>00000) 8.6.2 Global initialization 293
(
>>00000) 8.7 Namespaces 294
(
>>00000) 8.7.1 using declarations and using directives 296
Chapter 9 Technicalities: Classes, etc. 303
(
>>00000) 9.1 User-defined types 304
(
>>00000) 9.2 Classes and members 305
(
>>00000) 9.3 Interface and implementation 306
(
>>00000) 9.4 Evolving a class 308
(
>>00000) 9.4.1 struct and functions 308
(
>>00000) 9.4.2 Member functions and constructors 310
(
>>00000) 9.4.3 Keep details private 312
(
>>00000) 9.4.4 Defining member functions 314
(
>>00000) 9.4.5 Referring to the current object 317
(
>>00000) 9.4.6 Reporting errors 317
(
>>00000) 9.5 Enumerations 318
(
>>00000) 9.5.1 “Plain” enumerations 320
(
>>00000) 9.6 Operator overloading 321
(
>>00000) 9.7 Class interfaces 323
(
>>00000) 9.7.1 Argument types 324
(
>>00000) 9.7.2 Copying 326
(
>>00000) 9.7.3 Default constructors 327
(
>>00000) 9.7.4 const member fun
Edited last time by Chobitsu on 02/01/2023 (Wed) 15:54:03.