دسترسی نامحدود
برای کاربرانی که ثبت نام کرده اند
برای ارتباط با ما می توانید از طریق شماره موبایل زیر از طریق تماس و پیامک با ما در ارتباط باشید
در صورت عدم پاسخ گویی از طریق پیامک با پشتیبان در ارتباط باشید
برای کاربرانی که ثبت نام کرده اند
درصورت عدم همخوانی توضیحات با کتاب
از ساعت 7 صبح تا 10 شب
ویرایش: 8th Global Edition
نویسندگان: Deitel Paul. Deitel Harvey
سری:
ISBN (شابک) : 9780133976892, 9781292110974
ناشر: Pearson
سال نشر: 2016
تعداد صفحات: 1005
زبان: English
فرمت فایل : PDF (درصورت درخواست کاربر به PDF، EPUB یا AZW3 تبدیل می شود)
حجم فایل: 5 مگابایت
در صورت تبدیل فایل کتاب C How to Program_With an Introduction to C++ به فرمت های PDF، EPUB، AZW3، MOBI و یا DJVU می توانید به پشتیبان اطلاع دهید تا فایل مورد نظر را تبدیل نمایند.
توجه داشته باشید کتاب C چگونه برنامه ریزی کنیم_با مقدمه ای بر C نسخه زبان اصلی می باشد و کتاب ترجمه شده به فارسی نمی باشد. وبسایت اینترنشنال لایبرری ارائه دهنده کتاب های زبان اصلی می باشد و هیچ گونه کتاب ترجمه شده یا نوشته شده به فارسی را ارائه نمی دهد.
Cover Title Page Copyright Page Contents Preface 1 Introduction to Computers, the Internet and the Web 33 1.1 Introduction 34 1.2 Hardware and Software 35 1.2.1 Moore’s Law 35 1.2.2 Computer Organization 36 1.3 Data Hierarchy 37 1.4 Machine Languages, Assembly Languages and High-Level Languages 40 1.5 The C Programming Language 41 1.6 C Standard Library 42 1.7 C++ and Other C-Based Languages 43 1.8 Object Technology 44 1.8.1 The Automobile as an Object 45 1.8.2 Methods and Classes 45 1.8.3 Instantiation 45 1.8.4 Reuse 45 1.8.5 Messages and Method Calls 46 1.8.6 Attributes and Instance Variables 46 1.8.7 Encapsulation and Information Hiding 46 1.8.8 Inheritance 46 1.9 Typical C Program-Development Environment 47 1.9.1 Phase 1: Creating a Program 48 1.9.2 Phases 2 and 3: Preprocessing and Compiling a C Program 48 1.9.3 Phase 4: Linking 48 1.9.4 Phase 5: Loading 49 1.9.5 Phase 6: Execution 49 1.9.6 Problems That May Occur at Execution Time 49 1.9.7 Standard Input, Standard Output and Standard Error Streams 49 1.10 Test-Driving a C Application in Windows, Linux and Mac OS X 49 1.10.1 Running a C Application from the Windows Command Prompt 50 1.10.2 Running a C Application Using GNU C with Linux 53 1.10.3 Running a C Application Using the Teminal on Mac OS X 56 1.11 Operating Systems 59 1.11.1 Windows—A Proprietary Operating System 59 1.11.2 Linux—An Open-Source Operating System 59 1.11.3 Apple’s Mac OS X; Apple’s iOS for iPhone®, iPad® and iPod Touch® Devices 60 1.11.4 Google’s Android 60 1.12 The Internet and World Wide Web 61 1.12.1 The Internet: A Network of Networks 61 1.12.2 The World Wide Web: Making the Internet User-Friendly 61 1.12.3Web Services 62 1.12.4 Ajax 64 1.12.5 The Internet of Things 64 1.13 Some Key Software Terminology 64 1.14 Keeping Up-to-Date with Information Technologies 66 2 Introduction to C Programming 71 2.1 Introduction 72 2.2 A Simple C Program: Printing a Line of Text 72 2.3 Another Simple C Program: Adding Two Integers 76 2.4 Memory Concepts 80 2.5 Arithmetic in C 81 2.6 Decision Making: Equality and Relational Operators 85 2.7 Secure C Programming 89 3 Structured Program Development in C 101 3.1 Introduction 102 3.2 Algorithms 102 3.3 Pseudocode 102 3.4 Control Structures 103 3.5 The if Selection Statement 105 3.6 The if…else Selection Statement 106 3.7 The while Iteration Statement 110 3.8 Formulating Algorithms Case Study 1: Counter-Controlled Iteration 111 3.9 Formulating Algorithms with Top-Down, Stepwise Refinement Case Study 2: Sentinel-Controlled Iteration 114 3.10 Formulating Algorithms with Top-Down, Stepwise Refinement Case Study 3: Nested Control Statements 120 3.11 Assignment Operators 124 3.12 Increment and Decrement Operators 125 3.13 Secure C Programming 127 4 C Program Control 145 4.1 Introduction 146 4.2 Iteration Essentials 146 4.3 Counter-Controlled Iteration 147 4.4 for Iteration Statement 148 4.5 for Statement: Notes and Observations 151 4.6 Examples Using the for Statement 152 4.7 switch Multiple-Selection Statement 155 4.8 do…while Iteration Statement 161 4.9 break and continue Statements 162 4.10 Logical Operators 164 4.11 Confusing Equality (==) and Assignment (=) Operators 167 4.12 Structured Programming Summary 169 4.13 Secure C Programming 174 5 C Functions 189 5.1 Introduction 190 5.2 Modularizing Programs in C 190 5.3 Math Library Functions 191 5.4 Functions 193 5.5 Function Definitions 193 5.5.1 square Function 194 5.5.2 maximum Function 197 5.6 Function Prototypes: A Deeper Look 198 5.7 Function Call Stack and Stack Frames 200 5.8 Headers 204 5.9 Passing Arguments By Value and By Reference 205 5.10 Random Number Generation 206 5.11 Example: A Game of Chance; Introducing enum 210 5.12 Storage Classes 214 5.13 Scope Rules 216 5.14 Recursion 219 5.15 Example Using Recursion: Fibonacci Series 222 5.16 Recursion vs. Iteration 226 5.17 Secure C Programming 227 6 C Arrays 246 6.1 Introduction 247 6.2 Arrays 247 6.3 Defining Arrays 249 6.4 Array Examples 249 6.4.1 Defining an Array and Using a Loop to Set the Array’s Element Values 249 6.4.2 Initializing an Array in a Definition with an Initializer List 250 6.4.3 Specifying an Array’s Size with a Symbolic Constant and Initializing Array Elements with Calculations 252 6.4.4 Summing the Elements of an Array 253 6.4.5 Using Arrays to Summarize Survey Results 254 6.4.6 Graphing Array Element Values with Histograms 256 6.4.7 Rolling a Die 60,000,000 Times and Summarizing the Results in an Array 257 6.5 Using Character Arrays to Store and Manipulate Strings 257 6.5.1 Initializing a Character Array with a String 258 6.5.2 Initializing a Character Array with an Intializer List of Characters 258 6.5.3 Accessing the Characters in a String 258 6.5.4 Inputting into a Character Array 258 6.5.5 Outputting a Character Array That Represents a String 259 6.5.6 Demonstrating Character Arrays 259 6.6 Static Local Arrays and Automatic Local Arrays 260 6.7 Passing Arrays to Functions 262 6.8 Sorting Arrays 266 6.9 Case Study: Computing Mean, Median and Mode Using Arrays 268 6.10 Searching Arrays 273 6.10.1 Searching an Array with Linear Search 273 6.10.2 Searching an Array with Binary Search 274 6.11 Multidimensional Arrays 278 6.11.1 Illustrating a Double-Subcripted Array 278 6.11.2 Initializing a Double-Subcripted Array 279 6.11.3 Setting the Elements in One Row 281 6.11.4 Totaling the Elements in a Two-Dimensional Array 281 6.11.5 Two-Dimensonal Array Manipulations 282 6.12 Variable-Length Arrays² 285 6.13 Secure C Programming 288 7 C Pointers 306 7.1 Introduction 307 7.2 Pointer Variable Definitions and Initialization 308 7.3 Pointer Operators 309 7.4 Passing Arguments to Functions by Reference 311 7.5 Using the const Qualifier with Pointers 315 7.5.1 Converting a String to Uppercase Using a Non-Constant Pointer to Non-Constant Data 316 7.5.2 Printing a String One Character at a Time Using a Non-Constant Pointer to Constant Data 317 7.5.3 Attempting to Modify a Constant Pointer to Non-Constant Data 319 7.5.4 Attempting to Modify a Constant Pointer to Constant Data 320 7.6 Bubble Sort³ Using Pass-by-Reference 321 7.7 sizeof Operator 324 7.8 Pointer Expressions and Pointer Arithmetic 327 7.8.1 Allowed Operators for Pointer Arithmetic 327 7.8.2 Aiming a Pointer at an Array 327 7.8.3 Adding an Integer to a Pointer 328 7.8.4 Subtracting an Integer from a Pointer 328 7.8.5 Incrementing and Decrementing a Pointer 328 7.8.6 Subtracting One Pointer from Another 329 7.8.7 Assigning Pointers to One Another 329 7.8.8 Pointer to void 329 7.8.9 Comparing Pointers 329 7.9 Relationship between Pointers and Arrays 330 7.9.1 Pointer/Offset Notation 330 7.9.2 Pointer/Index Notation 331 7.9.3 Cannot Modify an Array Name with Pointer Arithmetic 331 7.9.4 Demonstrating Pointer Indexing and Offsets 331 7.9.5 String Copying with Arrays and Pointers 332 7.10 Arrays of Pointers 334 7.11 Case Study: Card Shuffling and Dealing Simulation 335 7.12 Pointers to Functions 340 7.12.1 Sorting in Ascending or Descending Order 340 7.12.2 Using Function Pointers to Create a Menu-Driven System 343 7.13 Secure C Programming 345 8 C Characters and Strings 365 8.1 Introduction 366 8.2 Fundamentals of Strings and Characters 366 8.3 Character-Handling Library 368 8.3.1 Functions isdigit, isalpha, isalnum and isxdigit 368 8.3.2 Functions islower, isupper, tolower and toupper 371 8.3.3 Functions isspace, iscntrl, ispunct, isprint and isgraph 372 8.4 String-Conversion Functions 374 8.4.1 Function strtod 374 8.4.2 Function strtol 375 8.4.3 Function strtoul 376 8.5 Standard Input/Output Library Functions 376 8.5.1 Functions fgets and putchar 377 8.5.2 Function getchar 378 8.5.3 Function sprintf 379 8.5.4 Function sscanf 380 8.6 String-Manipulation Functions of the String-Handling Library 381 8.6.1 Functions strcpy and strncpy 382 8.6.2 Functions strcat and strncat 382 8.7 Comparison Functions of the String-Handling Library 383 8.8 Search Functions of the String-Handling Library 385 8.8.1 Function strchr 386 8.8.2 Function strcspn 387 8.8.3 Function strpbrk 387 8.8.4 Function strrchr 388 8.8.5 Function strspn 389 8.8.6 Function strstr 389 8.8.7 Function strtok 390 8.9 Memory Functions of the String-Handling Library 391 8.9.1 Function memcpy 392 8.9.2 Function memmove 393 8.9.3 Function memcmp 394 8.9.4 Function memchr 394 8.9.5 Function memset 395 8.10 Other Functions of the String-Handling Library 395 8.10.1 Function strerror 396 8.10.2 Function strlen 396 8.11 Secure C Programming 397 9 C Formatted Input/Output 409 9.1 Introduction 410 9.2 Streams 410 9.3 Formatting Output with printf 410 9.4 Printing Integers 411 9.5 Printing Floating-Point Numbers 412 9.5.1 Conversion Specifiers e, E and f 413 9.5.2 Conversion Specifiers g and G 413 9.5.3 Demonstrating Floating-Point Conversion Specifiers 414 9.6 Printing Strings and Characters 414 9.7 Other Conversion Specifiers 415 9.8 Printing with Field Widths and Precision 416 9.8.1 Specifying Field Widths for Printing Integers 416 9.8.2 Specifying Precisions for Integers, Floating-Point Numbers and Strings 417 9.8.3 Combining Field Widths and Precisions 418 9.9 Using Flags in the printf Format Control String 419 9.9.1 Right and Left Justification 419 9.9.2 Printing Positive and Negative Numbers with and without the + Flag 420 9.9.3 Using the Space Flag 420 9.9.4 Using the # Flag 421 9.9.5 Using the 0 Flag 421 9.10 Printing Literals and Escape Sequences 422 9.11 Reading Formatted Input with scanf 422 9.11.1 scanf Syntax 423 9.11.2 scanf Conversion Specifiers 423 9.11.3 Reading Integers with scanf 424 9.11.4 Reading Floating-Point Numbers with scanf 425 9.11.5 Reading Characters and Strings with scanf 425 9.11.6 Using Scan Sets with scanf 426 9.11.7 Using Field Widths with scanf 427 9.11.8 Skipping Characters in an Input Stream 428 9.12 Secure C Programming 429 10 C Structures, Unions, Bit Manipulation and Enumerations 436 10.1 Introduction 437 10.2 Structure Definitions 437 10.2.1 Self-Referential Structures 438 10.2.2 Defining Variables of Structure Types 439 10.2.3 Structure Tag Names 439 10.2.4 Operations That Can Be Performed on Structures 439 10.3 Initializing Structures 440 10.4 Accessing Structure Members with . and -> 440 10.5 Using Structures with Functions 442 10.6 typedef 443 10.7 Example: High-Performance Card Shuffling and Dealing Simulation 443 10.8 Unions 446 10.8.1 Union Declarations 446 10.8.2 Operations That Can Be Performed on Unions 447 10.8.3 Initializing Unions in Declarations 447 10.8.4 Demonstrating Unions 447 10.9 Bitwise Operators 448 10.9.1 Displaying an Unsigned Integer in Bits 449 10.9.2 Making Function displayBits More Generic and Portable 451 10.9.3 Using the Bitwise AND, Inclusive OR, Exclusive OR and Complement Operators 452 10.9.4 Using the Bitwise Left- and Right-Shift Operators 455 10.9.5 Bitwise Assignment Operators 456 10.10 Bit Fields 457 10.10.1 Defining Bit Fields 457 10.10.2 Using Bit Fields to Represent a Card’s Face, Suit and Color 458 10.10.3 Unnamed Bit Fields 460 10.11 Enumeration Constants 460 10.12 Anonymous Structures and Unions 462 10.13 Secure C Programming 462 11 C File Processing 473 11.1 Introduction 474 11.2 Files and Streams 474 11.3 Creating a Sequential-Access File 475 11.3.1 Pointer to a FILE 477 11.3.2 Using fopen to Open the File 477 11.3.3 Using feof to Check for the End-of-File Indicator 477 11.3.4 Using fprintf to Write to the File 478 11.3.5 Using fclose to Close the File 478 11.3.6 File Open Modes 479 11.4 Reading Data from a Sequential-Access File 481 11.4.1 Resetting the File Position Pointer 482 11.4.2 Credit Inquiry Program 482 11.5 Random-Access Files 486 11.6 Creating a Random-Access File 486 11.7 Writing Data Randomly to a Random-Access File 488 11.7.1 Positioning the File Position Pointer with fseek 490 11.7.2 Error Checking 491 11.8 Reading Data from a Random-Access File 491 11.9 Case Study: Transaction-Processing Program 493 11.10 Secure C Programming 498 12 C Data Structures 509 12.1 Introduction 510 12.2 Self-Referential Structures 511 12.3 Dynamic Memory Allocation 511 12.4 Linked Lists 512 12.4.1 Function insert 518 12.4.2 Function delete 519 12.4.3 Function printList 521 12.5 Stacks 521 12.5.1 Function push 525 12.5.2 Function pop 526 12.5.3 Applications of Stacks 526 12.6 Queues 527 12.6.1 Function enqueue 531 12.6.2 Function dequeue 532 12.7 Trees 533 12.7.1 Function insertNode 536 12.7.2 Traversals: Functions inOrder, preOrder and postOrder 537 12.7.3 Duplicate Elimination 538 12.7.4 Binary Tree Search 538 12.7.5 Other Binary Tree Operations 538 12.8 Secure C Programming 538 13 C Preprocessor 550 13.1 Introduction 551 13.2 #include Preprocessor Directive 551 13.3 #define Preprocessor Directive: Symbolic Constants 552 13.4 #define Preprocessor Directive: Macros 553 13.4.1 Macro with One Argument 553 13.4.2 Macro with Two Arguments 554 13.4.3 Macro Continuation Character 554 13.4.4 #undef Preprocessor Directive 554 13.4.5 Standard Library Functions and Macros 554 13.4.6 Do Not Place Expressions with Side Effects in Macros 555 13.5 Conditional Compilation 555 13.5.1 #if…#endif Preprocessor Directive 555 13.5.2 Commenting Out Blocks of Code with #if…#endif 555 13.5.3 Conditionally Compiling Debugging Code 556 13.6 #error and #pragma Preprocessor Directives 556 13.7 # and ## Operators 556 13.8 Line Numbers 557 13.9 Predefined Symbolic Constants 557 13.10 Assertions 558 13.11 Secure C Programming 558 14 Other C Topics 563 14.1 Introduction 564 14.2 Redirecting I/O 564 14.2.1 Redirecting Input with < 564 14.2.2 Redirecting Input with | 565 14.2.3 Redirecting Output 565 14.3 Variable-Length Argument Lists 565 14.4 Using Command-Line Arguments 567 14.5 Compiling Multiple-Source-File Programs 569 14.5.1 extern Declarations for Global Variables in Other Files 569 14.5.2 Function Prototypes 569 14.5.3 Restricting Scope with static 570 14.5.4 Makefiles 570 14.6 Program Termination with exit and atexit 570 14.7 Suffixes for Integer and Floating-Point Literals 572 14.8 Signal Handling 572 14.9 Dynamic Memory Allocation: Functions calloc and realloc 575 14.10 Unconditional Branching with goto 575 15 C++ as a Better C; Introducing Object Technology 581 15.1 Introduction 582 15.2 C++ 582 15.3 A Simple Program: Adding Two Integers 583 15.3.1 Addition Program in C++ 583 15.3.2Header 584 15.3.3 main Function 584 15.3.4 Variable Declarations 584 15.3.5 Standard Output Stream and Standard Input Stream Objects 584 15.3.6 std::endl Stream Manipulator 585 15.3.7 std:: Explained 585 15.3.8 Concatenated Stream Outputs 585 15.3.9 return Statement Not Required in main 585 15.3.10 Operator Overloading 585 15.4 C++ Standard Library 586 15.5 Header Files 586 15.6 Inline Functions 588 15.7 C++ Keywords 590 15.8 References and Reference Parameters 591 15.8.1 Reference Parameters 591 15.8.2 Passing Arguments by Value and by Reference 592 15.8.3 References as Aliases within a Function 594 15.8.4 Returning a Reference from a Function 595 15.8.5 Error Messages for Uninitialized References 596 15.9 Empty Parameter Lists 596 15.10 Default Arguments 596 15.11 Unary Scope Resolution Operator 598 15.12 Function Overloading 599 15.13 Function Templates 602 15.13.1 Defining a Function Template 602 15.13.2 Using a Function Template 603 15.14 Introduction to Object Technology and the UML 605 15.14.1 Basic Object Technology Concepts 605 15.14.2 Classes, Data Members and Member Functions 606 15.14.3 Object-Oriented Analysis and Design 607 15.14.4 The Unified Modeling Language 608 15.15 Introduction to C++ Standard Library Class Template vector 608 15.15.1 Problems Associated with C-Style Pointer-Based Arrays 608 15.15.2 Using Class Template vector 609 15.15.3 Exception Handling: Processing an Out-of-Range Index 613 15.16 Wrap-Up 615 16 Introduction to Classes, Objects and Strings 621 16.1 Introduction 622 16.2 Defining a Class with a Member Function 622 16.3 Defining a Member Function with a Parameter 625 16.4 Data Members, set Member Functions and get Member Functions 629 16.5 Initializing Objects with Constructors 634 16.6 Placing a Class in a Separate File for Reusability 638 16.7 Separating Interface from Implementation 642 16.8 Validating Data with set Functions 647 16.9 Wrap-Up 652 17 Classes: A Deeper Look; Throwing Exceptions 659 17.1 Introduction 660 17.2 Time Class Case Study 661 17.3 Class Scope and Accessing Class Members 667 17.4 Access Functions and Utility Functions 668 17.5 Time Class Case Study: Constructors with Default Arguments 669 17.6 Destructors 675 17.7 When Constructors and Destructors Are Called 675 17.8 Time Class Case Study: A Subtle Trap— Returning a Reference or a Pointer to a private Data Member 679 17.9 Default Memberwise Assignment 682 17.10 const Objects and const Member Functions 684 17.11 Composition: Objects as Members of Classes 686 17.12 friend Functions and friend Classes 692 17.13 Using the this Pointer 694 17.14 static Class Members 700 17.15 Wrap-Up 705 18 Operator Overloading; Class string 715 18.1 Introduction 716 18.2 Using the Overloaded Operators of Standard Library Class string 717 18.3 Fundamentals of Operator Overloading 720 18.4 Overloading Binary Operators 721 18.5 Overloading the Binary Stream Insertion and Stream Extraction Operators 722 18.6 Overloading Unary Operators 726 18.7 Overloading the Unary Prefix and Postfix ++ and -- Operators 727 18.8 Case Study: A Date Class 728 18.9 Dynamic Memory Management 733 18.10 Case Study: Array Class 735 18.10.1 Using the Array Class 736 18.10.2 Array Class Definition 740 18.11 Operators as Member vs. Non-Member Functions 748 18.12 Converting Between Types 748 18.13 explicit Constructors and Conversion Operators 750 18.14 Overloading the Function Call Operator () 752 18.15 Wrap-Up 753 19 Object-Oriented Programming: Inheritance 764 19.1 Introduction 765 19.2 Base Classes and Derived Classes 765 19.3 Relationship between Base and Derived Classes 768 19.3.1 Creating and Using a CommissionEmployee Class 768 19.3.2 Creating a BasePlusCommissionEmployee Class Without Using Inheritance 773 19.3.3 Creating a CommissionEmployee–BasePlusCommissionEmployee Inheritance Hierarchy 779 19.3.4 CommissionEmployee–BasePlusCommissionEmployee Inheritance Hierarchy Using protected Data 783 19.3.5 CommissionEmployee–BasePlusCommissionEmployee Inheritance Hierarchy Using private Data 786 19.4 Constructors and Destructors in Derived Classes 791 19.5 public, protected and private Inheritance 793 19.6 Software Engineering with Inheritance 794 19.7 Wrap-Up 794 20 Object-Oriented Programming: Polymorphism 799 20.1 Introduction 800 20.2 Introduction to Polymorphism: Polymorphic Video Game 801 20.3 Relationships Among Objects in an Inheritance Hierarchy 801 20.3.1 Invoking Base-Class Functions from Derived-Class Objects 802 20.3.2 Aiming Derived-Class Pointers at Base-Class Objects 805 20.3.3 Derived-Class Member-Function Calls via Base-Class Pointers 806 20.3.4 Virtual Functions and Virtual Destructors 808 20.4 Type Fields and switch Statements 815 20.5 Abstract Classes and Pure virtual Functions 815 20.6 Case Study: Payroll System Using Polymorphism 817 20.6.1 Creating Abstract Base Class Employee 818 20.6.2 Creating Concrete Derived Class SalariedEmployee 822 20.6.3 Creating Concrete Derived Class CommissionEmployee 824 20.6.4 Creating Indirect Concrete Derived Class BasePlusCommissionEmployee 826 20.6.5 Demonstrating Polymorphic Processing 828 20.7 (Optional) Polymorphism, Virtual Functions and Dynamic Binding “Under the Hood” 832 20.8 Case Study: Payroll System Using Polymorphism and Runtime Type Information with Downcasting, dynamic_cast, typeid and type_info 835 20.9 Wrap-Up 839 21 Stream Input/Output: A Deeper Look 844 21.1 Introduction 845 21.2 Streams 846 21.2.1 Classic Streams vs. Standard Streams 846 21.2.2 iostream Library Headers 847 21.2.3 Stream Input/Output Classes and Objects 847 21.3 Stream Output 849 21.3.1 Output of char * Variables 850 21.3.2 Character Output Using Member Function put 850 21.4 Stream Input 851 21.4.1 get and getline Member Functions 851 21.4.2 istream Member Functions peek, putback and ignore 854 21.4.3 Type-Safe I/O 854 21.5 Unformatted I/O Using read, write and gcount 854 21.6 Introduction to Stream Manipulators 855 21.6.1 Integral Stream Base: dec, oct, hex and setbase 856 21.6.2 Floating-Point Precision (precision, setprecision) 856 21.6.3 Field Width (width, setw) 858 21.6.4 User-Defined Output Stream Manipulators 859 21.7 Stream Format States and Stream Manipulators 860 21.7.1 Trailing Zeros and Decimal Points (showpoint) 861 21.7.2 Justification (left, right and internal) 862 21.7.3 Padding (fill, setfill) 864 21.7.4 Integral Stream Base (dec, oct, hex, showbase) 865 21.7.5 Floating-Point Numbers; Scientific and Fixed Notation (scientific, fixed) 866 21.7.6 Uppercase/Lowercase Control (uppercase) 867 21.7.7 Specifying Boolean Format (boolalpha) 867 21.7.8 Setting and Resetting the Format State via Member Function flags 868 21.8 Stream Error States 869 21.9 Tying an Output Stream to an Input Stream 872 21.10 Wrap-Up 872 22 Exception Handling: A Deeper Look 881 22.1 Introduction 882 22.2 Example: Handling an Attempt to Divide by Zero 882 22.3 Rethrowing an Exception 888 22.4 Stack Unwinding 889 22.5 When to Use Exception Handling 891 22.6 Constructors, Destructors and Exception Handling 892 22.7 Exceptions and Inheritance 893 22.8 Processing new Failures 893 22.9 Class unique_ptr and Dynamic Memory Allocation 896 22.10 Standard Library Exception Hierarchy 899 22.11 Wrap-Up 900 23 Introduction to Custom Templates 906 23.1 Introduction 907 23.2 Class Templates 907 23.3 Function Template to Manipulate a Class-Template Specialization Object 912 23.4 Nontype Parameters 914 23.5 Default Arguments for Template Type Parameters 914 23.6 Overloading Function Templates 915 23.7 Wrap-Up 915 A. C and C++ Operator Precedence Charts 918 B. ASCII Character Set 922 C. Number Systems 923 C.1 Introduction 924 C.2 Abbreviating Binary Numbers as Octal and Hexadecimal Numbers 927 C.3 Converting Octal and Hexadecimal Numbers to Binary Numbers 928 C.4 Converting from Binary, Octal or Hexadecimal to Decimal 928 C.5 Converting from Decimal to Binary, Octal or Hexadecimal 929 C.6 Negative Binary Numbers: Two’s Complement Notation 931 D. Sorting: A Deeper Look 936 D.1 Introduction 937 D.2 Big O Notation 937 D.3 Selection Sort 938 D.4 Insertion Sort 942 D.5 Merge Sort 945 E. Multithreading and Other C11 and C99 Topics 956 E.1 Introduction 957 E.2 New C99 Headers 958 E.3 Designated Initializers and Compound Literals 959 E.4 Type bool 961 E.5 Implicit int in Function Declarations 963 E.6 Complex Numbers 964 E.7 Additions to the Preprocessor 965 E.8 Other C99 Features 966 E.8.1 Compiler Minimum Resource Limits 966 E.8.2 The restrict Keyword 967 E.8.3 Reliable Integer Division 967 E.8.4 Flexible Array Members 967 E.8.5 Relaxed Constraints on Aggregate Initialization 968 E.8.6 Type Generic Math 968 E.8.7 Inline Functions 968 E.8.8 Return Without Expression 969 E.8.9 __func__ Predefined Identifier 969 E.8.10 va_copy Macro 969 E.9 New Features in the C11 Standard 969 E.9.1 New C11 Headers 970 E.9.2 Multithreading Support 970 E.9.3 quick_exit function 978 E.9.4 Unicode® Support 978 E.9.5 _Noreturn Function Specifier 978 E.9.6 Type-Generic Expressions 978 E.9.7 Annex L: Analyzability and Undefined Behavior 979 E.9.8 Memory Alignment Control 979 E.9.9 Static Assertions 979 E.9.10 Floating-Point Types 980 E.10 Web Resources 980 Appendices on the Web 983 Index 984 A B C D E F G H I J K L M N O P Q R S T U V W X Z