Slutsåld
Bjarne Stroustrup is the designer and original implementer of C++, the author of The C++ Programming Language, The Annotated C++ Reference Manual, and The Design and Evolution of C++, and the consulting editor of Addison-Wesley's C++ In-Depth Series. Having previously worked at Bell Labs and AT&T Labs-Research, he currently is the College of Engineering Chair in Computer Science Professor at Texas A&M University. The recipient of numerous honors, including the Dr. Dobb's Excellence in Programming Award (2008), Dr. Stroustrup is a member of the National Academy of Engineering, an AT&T Fellow, an AT&T Bell Laboratories Fellow, an IEEE Fellow, and an ACM Fellow. His research interests include distributed systems, simulation, design, programming techniques, software development tools, and programming languages, and he remains actively involved in the ANSI/ISO standardization of C++. Dr. Stroustrup holds an advanced degree from the University of Aarhus in his native Denmark and a Ph.D. in Computer Science from Cambridge University, England.
Preface xxiii
Chapter 0: Notes to the Reader 1
0.1 The structure of this book 2
0.2 A philosophy of teaching and learning 6
0.3 Programming and computer science 12
0.4 Creativity and problem solving 12
0.5 Request for feedback 12
0.6 References 13
0.7 Biographies 14
Chapter 1: Computers, People, and Programming 17
1.1 Introduction 18
1.2 Software 19
1.3 People 21
1.4 Computer science 24
1.5 Computers are everywhere 25
1.6 Ideals for programmers 34
Part I: The Basics 41
Chapter 2: Hello,World! 43
2.1 Programs 44
2.2 The classic first program 45
2.3 Compilation 47
2.4 Linking 51
2.5 Programming environments 52
Chapter 3: Objects, Types, and Values 59
3.1 Input 60
3.2 Variables 62
3.3 Input and type 64
3.4 Operations and operators 66
3.5 Assignment and initialization 69
3.6 Composite assignment operators 73
3.7 Names 74
3.8 Types and objects 77
3.9 Type safety 78
Chapter 4: Computation 89
4.1 Computation 90
4.2 Objectives and tools 92
4.3 Expressions 94
4.4 Statements 99
4.5 Functions 112
4.6 Vector 116
4.7 Language features 123
Chapter 5: Errors 131
5.1 Introduction 132
5.2 Sources of errors 134
5.3 Compile-time errors 134
5.4 Link-time errors 137
5.5 Run-time errors 138
5.6 Exceptions 144
5.7 Logic errors 152
5.8 Estimation 155
5.9 Debugging 156
5.10 Pre- and post-conditions 161
5.11 Testing 164
Chapter 6: Writing a Program 171
6.1 A problem 172
6.2 Thinking about the problem 173
6.3 Back to the calculator! 176
6.4 Grammars 186
6.5 Turning a grammar into code 193
6.6 Trying the first version 201
6.7 Trying the second version 206
6.8 Token streams 207
6.9 Program structure 213
Chapter 7: Completing a Program 219
7.1 Introduction 220
7.2 Input and output 220
7.3 Error handling 222
7.4 Negative numbers 227
7.5 Remainder: % 228
7.6 Cleaning up the code 231
7.7 Recovering from errors 238
7.8 Variables 241
Chapter 8: Technicalities: Functions, etc. 253
8.1 Technicalities 254
8.2 Declarations and definitions 255
8.3 Header files 261
8.4 Scope 264
8.5 Function call and return 269
8.6 Order of evaluation 287
8.7 Namespaces 290
Chapter 9: Technicalities: Classes, etc. 299
9.1 User-defined types 300
9.2 Classes and members 301
9.3 Interface and implementation 302
9.4 Evolving a class 304
9.5 Enumerations 314
9.6 Operator overloading 316
9.7 Class interfaces 318
9...