| PrefaceChapter 0 Notes to the Reader0.1 The structure of this book0.1.1 General approach0.1.2 Drills, exercises, etc.0.1.3 What comes after this book?0.2 A philosophy of teaching and learning0.2.1 The order of topics0.2.2 Programming and programming language0.2.3 Portability 0.3 Programming and computer science0.4 Creativity and problem solving0.5 Request for feedback0.6 References0.7 BiographiesBjarne StroustrupLawrence "Pete" PcterscnChapter 1 Computers, People, and Programming1.1 introduction1.2 Software1.3 People1.4 Computer science1.5 Computers are everywhere1.5.1 Screens and no screens1.5.2 Shipping1.5.3 Telecommunications1.5.4 Medicine1.5.5 Information1.5.6 A verdcal view1.5.7 So what?1.6 Ideals for programmersPart Ⅰ The Basics Chapter 2 Hello, World!2.1 Programs2.2 The dassic first program2.3 Compilation2.4 Linking 2.5 Programming environmentsChapter 3 Objects, Types, and Values3.1 Input 3.2 Variables3.3 Input and type3.4 Operations and operators3.5 Assignment and initialization3.5.1 An example: detect repeated words3.6 Composite assignment operators3.6.1 An example: find repeated words3.7 Names3.8 Types and objects3.9 Type safety3.9.1 Safe conversions3.9.2 Unsafe conversionsChapter 4 Computation4.1 Computation4.2 Objectives and tools4.3 Expressions 4.3.1 Constant expressions4.3.2 Operators4.3.3 Conversions4.4 Statements4.4.1 Selection4.4.2 Iteration4.5 Functions4.5.1 Why bother with functions?4.5.2 Function declarations4.6 Vector4.6.1 Growing a vector4.6.2 A numeric example4.6.3 A text example4.7 Language featuresChapter 5 Errors5.1Introduction5.2Sources of errors5.3Compile-time errors5.3.1 Syntax errors5.3.2 Type errors5.3.3 Non-errors5.4Link-time errors5.5Run-time errors5.5.1 The caller deals with errors5.5.2 The callee deals with errors5.5.3 Error reporting5.6Exceptions5.6.1 Bad arguments5.6.2 Range errors5.6.3 Bad input5.6.4 Narrowing errors5.7Logic errors5.8Estimation5.9 Debugging 5.9.1 Practical debug advice5.10 Pre-and post-conditions5.10.1 Post-conditions5.11 TestingChapter 6 Writing a Program6.1 A problem6.2 Thinking about the problem6.2.1 Stages of development6.2.2 Strategy6.3 Back to the calculator!6.3.1 First attempt6.3.2 Tokens6.3.3 Implementing tokens6.3.4 Using tokens6.3.5 Back to the drawing board6.4 Grammars6.4.1 A detour: English grammar6.4.2 Writing a grammar6.5 Turning a grammar into code6.5.1 Implementing grammar rules6.5.2 Expressions6.5.3 Terms6.5.4 Primary expressions6.6 Trying the first version6.7 Trying the second version6.8 Token streams6.8.1 Implementing Token_stream6.8.2 Reading tokens6.8.3 Reading numbers6.9 Program structureChapter 7 Completing a Program7.1 Introduction7.2 Input and output7.3 Error handling7.4 Negative numbers7.5 Remainder: %7.6 Cleaning up the code7.6.1 Symbolic constants7.6.2 Use of functions7.6.3 Gode layout7.6.4 Commenting7.7 Recovering from errors7.8 Variables7.8.1 Variables and definitions7.8.2 Introducing names7.8.3 Predefined names7.8.4 Are we there yet? |
商品评论(0条)