Slutsåld
Bestselling Programming Tutorial and Reference Completely Rewritten for the New C++11 Standard Fully updated and recast for the newly released C++11 standard, this authoritative and comprehensive introduction to C++ will help you to learn the lang...
Stan Lippman, former C++ Report Editor (and best-selling author), brings you pearls of wisdom for getting the most out of C++. This carefully selected collection covers the first seven years of the C++ Report, from January 1989 through December 19...
Preface xixChapter 1. Getting Started 11.1 Writing a Simple C++ Program 2 1.2 A First Look at Input/Output 5 1.3 A Word About Comments 10 1.4 Control Structures 11 1.5 Introducing Classes 20 1.6 The C++ Program 25 Chapter Summary 28 Defined Terms 28 Part I. The Basics 31Chapter 2. Variables and Basic Types 33 2.1 Primitive Built-in Types 34 2.2 Literal Constants 37 2.3 Variables 43 2.4 const Qualifier 56 2.5 References 58 2.6 Typedef Names 61 2.7 Enumerations 62 2.8 Class Types 63 2.9 Writing Our Own Header Files 67 Chapter Summary 73 Defined Terms 73Chapter 3. Library Types 77 3.1 Namespace using Declarations 78 3.2 Library string Type 80 3.3 Library vector Type 90 3.4 Introducing Iterators 95 3.4.1 Iterator Arithmetic 100 3.5 Library bitset Type 101 Chapter Summary 107 Defined Terms 107 Chapter 4. Arrays and Pointers 1094.1 Arrays 110 4.2 Introducing Pointers 114 4.3 C-Style Character Strings 130 4.4 Multidimensioned Arrays 141 Chapter Summary 145 Defined Terms 145 Chapter 5. Expressions 147 5.1 Arithmetic Operators 149 5.2 Relational and Logical Operators 152 5.3 The Bitwise Operators 154 5.4 Assignment Operators 159 5.5 Increment and Decrement Operators 162 5.6 The Arrow Operator 164 5.7 The Conditional Operator 165 5.8 The size of Operator 167 5.9 Comma Operator 168 5.10 Evaluating Compound Expressions 168 5.11 The new and delete Expressions 174 5.12 Type Conversions 178 Chapter Summary 188 Defined Terms 188 Chapter 6. Statements 191 6.1 Simple Statements 192 6.2 Declaration Statements 193 6.3 Compound Statements (Blocks) 193 6.4 Statement Scope 194 6.5 The if Statement 195 6.5.1 The if Statement else Branch 197 6.6 The switch Statement 199 6.7 The whileStatement 204 6.8 The for Loop Statement 207 6.9 The do while Statement 210 6.10 The break Statement 212 6.11 The continue Statement 214 6.12 The goto Statement 214 6.13 try Blocks and Exception Handling 215 6.13.1 A throw Expression 216 6.13.2 The try Block 217 6.13.3 Standard Exceptions 219 6.14 Using the Preprocessor for Debugging 220 Chapter Summary 223 Defined Terms 223 Chapter 7. Functions 225 7.1 Defining a Function 226 7.2 Argument Passing 229 7.3 The return Statement 245 7.4 Function Declarations 251 7.5 Local Objects 254 7.6 Inline Functions 256 7.7 ClassMemberFunctions 258 7.8 Overloaded Functions 265 7.9 Pointers to Functions 276 Chapter Summary 280 Defined Terms 280Chapter 8. The IO Library 283 8.1 An Object-Oriented Library 284 8.2 Condition States 287 8.3 Managing the Output Buffer 290 8.4 File Input and Output 293 8.5 String Streams 299 Chapter Summary 302 Defined Terms 302Part II. Containers and Algorithms 303Chapter 9. Sequential Containers 3059.1 Defining a Sequential Container 307 9.2 Iterators andIteratorRanges 311 9.3 Sequence Container Operations 316 9.4 How a vector Grows 330 9.5 Deciding Which Container to Use 333 9.6 strings Revisited 335 9.7 Container Adaptors 348 Chapter Summary 353 Defined Terms 353Chapter 10. Associative Containers 35510.1 Preliminaries: the pair Type 356 10.2 Associative Containers 358 10.3 The map Type 360 10.4 The set Type 372 10.5 The multimap and multiset Types 375 10.6 Using Containers: Text-Query Program 379 Chapter Summary 388 Defined Terms 388 Chapter 11. Generic Algorithms 39111.1 Overview 392 11.2 A First Look at the Algorithms 395 11.3 Revisiting Iterators 405 11.4 Structure of Generic Algorithms 419 11.5 Container-Specific Algorithms 421 Chapter Summary 424
Preface xixChapter 1. Getting Started 11.1 Writing a Simple C++ Program 2 1.2 A First Look at Input/Output 5 1.3 A Word About Comments 10 1.4 Control Structures 11 1.5 Introducing Classes 20 1.6 The C++ Program 25 Chapter Summary 28 Defined Terms 28 Part I. The Basics 31Chapter 2. Variables and Basic Types 33 2.1 Primitive Built-in Types 34 2.2 Literal Constants 37 2.3 Variables 43 2.4 const Qualifier 56 2.5 References 58 2.6 Typedef Names 61 2.7 Enumerations 62 2.8 Class Types 63 2.9 Writing Our Own Header Files 67 Chapter Summary 73 Defined Terms 73Chapter 3. Library Types 77 3.1 Namespace using Declarations 78 3.2 Library string Type 80 3.3 Library vector Type 90 3.4 Introducing Iterators 95 3.4.1 Iterator Arithmetic 100 3.5 Library bitset Type 101 Chapter Summary 107 Defined Terms 107 Chapter 4. Arrays and Pointers 1094.1 Arrays 110 4.2 Introducing Pointers 114 4.3 C-Style Character Strings 130 4.4 Multidimensioned Arrays 141 Chapter Summary 145 Defined Terms 145 Chapter 5. Expressions 147 5.1 Arithmetic Operators 149 5.2 Relational and Logical Operators 152 5.3 The Bitwise Operators 154 5.4 Assignment Operators 159 5.5 Increment and Decrement Operators 162 5.6 The Arrow Operator 164 5.7 The Conditional Operator 165 5.8 The size of Operator 167 5.9 Comma Operator 168 5.10 Evaluating Compound Expressions 168 5.11 The new and delete Expressions 174 5.12 Type Conversions 178 Chapter Summary 188 Defined Terms 188 Chapter 6. Statements 191 6.1 Simple Statements 192 6.2 Declaration Statements 193 6.3 Compound Statements (Blocks) 193 6.4 Statement Scope 194...