1. Trang chủ
  2. » Thể loại khác

Big c++ horstmann 2ndbig c++ horstmann 2nd pdf

1.1K 684 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Cấu trúc

  • Copyright

  • Preface

  • Contents

  • Chapter 1: Introduction

    • What Is a Computer?

    • What Is Programming?

    • The Anatomy of a Computer

    • Translating Human-Readable Programs to Machine Code

    • Programming Languages

    • The Evolution of C++

    • Becoming Familiar with Your Computer

    • Compiling a Simple Program

    • Errors

    • The Compilation Process

    • Algorithms

  • Chapter 2: Numbers and Objects

    • Number Types

    • Input

    • Assignment

    • Constants

    • Arithmetic

    • Strings

    • Using Objects

    • Displaying Graphical Shapes (Optional)

  • Chapter 3: Control Flow

    • The if Statement

    • Relational Operators

    • Multiple Alternatives

    • Nested Branches

    • Boolean Operations

    • The while Loop

    • The for Loop

    • The do Loop

    • Nested Loops

    • Processing Inputs

    • Simulations

  • Chapter 4: Functions

    • Functions as Black Boxes

    • Implementing Functions

    • Function Comments

    • Return Values

    • Parameters

    • Side Effects

    • Procedures

    • Reference Parameters

    • Variable Scope and Global Variables

    • Stepwise Refinement

    • Case Study: From Pseudocode to Code

    • Walkthroughs

    • Preconditions

    • Unit Testing

    • The Debugger

  • Chapter 5: Classes

    • Discovering Classes

    • Interfaces

    • Encapsulation

    • Member Functions

    • Default Constructors

    • Constructors with Parameters

    • Accessing Data Fields

    • Comparing Member Functions with Nonmember Functions

    • Separate Compilation

  • Chapter 6: Vectors and Arrays

    • Using Vectors to Collect Data Items

    • Working with Vectors

    • Vector Parameters and Return Values

    • Removing and Inserting Vector Elements

    • Arrays

  • Chapter 7: Pointers

    • Pointers and Memory Allocation

    • Deallocating Dynamic Memory

    • Common Uses for Pointers

    • Arrays and Pointers

    • Pointers to Character Strings

    • Pointers to Functions

  • Chapter 8: Inheritance

    • Derived Classes

    • Calling the Base-Class Constructor

    • Overriding Member Functions

    • Polymorphism

  • Chapter 9: Streams

    • Reading and Writing Text Files

    • The Inheritance Hierarchy of Stream Classes

    • Stream Manipulators

    • String Streams

    • Command Line Arguments

    • Random Access

  • Chapter 10: Recursion

    • Triangle Numbers

    • Permutations

    • Thinking Recursively

    • Recursive Helper Functions

    • Mutual Recursion

    • The Efficiency of Recursion

  • Chapter 11: Sorting and Searching

    • Selection Sort

    • Profiling the Selection Sort Algorithm

    • Analyzing the Performance of the Selection Sort Algorithm

    • Merge Sort

    • Analyzing the Merge Sort Algorithm

    • Searching

    • Library Functions for Sorting and Binary Search

  • Chapter 12: Lists, Queues, and Stacks

    • Linked Lists

    • Implementing Linked LIsts

    • The Efficiency of List and Vector Operations

    • Queues and Stacks

  • Chapter 13: Sets, Maps, and Priority Queues

    • Sets

    • Binary Search Trees

    • Tree Traversal

    • Maps

    • Priority Queues

    • Heaps

  • Chapter 14: Operator Overloading

    • Operator Overloading

    • Case Study: Fractional Numbers

    • Overloading Simple Arithmetic Operators

    • Overloading Comparison Operators

    • Overloading Input and Output

    • Overloading Increment and Decrement Operators

    • Overloading the Assignment Operators

    • Overloading Conversion Operators

    • Overloading the Subscript Operator

    • Overloading the Function Call Operator

    • Case Study: Matrices

  • Chapter 15: Memory Management

    • Categories of Memory

    • Common Memory Errors

    • Constructors

    • Destructors

    • Reference Counting

    • Case Study: Matrices, Continued

  • Chapter 16: Templates

    • Template Functions

    • Compile-Time Polymorphism

    • Template Classes

    • Turning a Class into a Template

    • Nontype Template Parameters

    • Setting Behavior Using Template Parameters

    • Case Study: Matrices, Continued

  • Chapter 17: Exception Handling

    • Handling Exceptional Situations

    • Alternative Mechanisms for Handling Exceptions

    • Exceptions

    • Case Study: Matrices, Continued

  • Chapter 18: Name Scope Management

    • Encapsulation

    • Name Scopes

    • Protected Scope

    • Friends

    • Nested Classes

    • Private Inheritance

    • Name Spaces

    • Case Study: Matrices, Continued

  • Chapter 19: Class Hierarchies

    • Class Inheritance Hierarchies

    • Abstract Classes

    • Obtaining Run-Time Type Information

    • Multiple Inheritance

    • Software Frameworks

  • Chapter 20: The Standard Template Library

    • The STL

    • Iterators

    • The Fundamental Containers

    • Container Adapters

    • Associative Containers

    • Case Study: Dijkstra’s Shortest Algorithm

    • Functions, Generators, and Predicates

    • Generic Algorithms

    • Iterator Adapters

    • Case Study: File Merge Sort

  • Chapter 21: Features of the C++0x Standard

    • C++0x Design Objectives

    • Automatic Type Inference

    • Range-based for Loop

    • New Constructor Features

    • Regular Expressions

    • Lambda Functions

    • Controlling Default Implementations

    • Hash Tables

    • Concepts

    • Other Minor Changes

  • Chapter 22: Object-Oriented Design

    • The Software Life Cycle

    • CRC Cards

    • Cohesion

    • Coupling

    • Relationships Between Classes

    • Implementing Aggregations

    • Case Study: Printing an Invoice

    • Case Study: An Educational Game

  • Chapter 23: The Unified Modeling Language

    • The Unified Modeling Language

    • Use Cases

    • Sequence Diagrams

    • State Diagrams

    • Case Study: A Voice Mail System

  • Chapter 24: An Introduction to Design Patterns

    • Iterators

    • The Pattern Concept

    • The ADAPTER Pattern

    • The TEMPLATE METHOD Pattern

    • Function Objects and the STRATEGY Pattern

    • The COMPOSITE Pattern

    • Case Study: Putting Patterns to Work

  • Appendix A: C++ Language Coding Guidelines

  • Appendix B: Keyword Summary

  • Appendix C: Operator Summary

  • Appendix D: Character Codes

  • Appendix E: C++ Library Summary

  • Appendix F: Number Systems

  • Appendix G: Bit and Shift Operations

  • Appendix H: UML Summary

  • Appendix I: A C++ / Java Comparison

  • Glossary

  • Index

  • Illustration Credits

Nội dung

Why WileyPLUS for Computer Science? W ileyPLUS for Computer Science is a dynamic online environment that motivates students to spend more time practicing the problems and explore the material they need to master in order to succeed “I used the homework problems to practice before quizzes and tests I re-did the problems on my own and then checked WileyPLUS to compare answers.” — Student Alexandra Leifer, Ithaca College The integrated, online text offers students a low-cost alternative to the printed text, enhanced with direct links to specific portions of the text, plus interactive animations and videos to help students visualize concepts Select WileyPLUS courses include LabRat, the programming assignment tool allows you to choose from hundreds of programming exercises to automate the process of assigning, completing, compiling, testing, submitting, and evaluating programming assignments When students spend more time practicing, they come to class better prepared Try WileyPLUS with LabRat: www.wileyplus.com/tours See and try WileyPLUS in action! Details and Demo: www.wileyplus.com WileyPLUS combines robust course management tools with the complete online text and all of the interactive teaching & learning resources you and your students need in one easy-to-use system “Overall the WileyPLUS package made the material more interesting than if it was just a book with no additional material other than what you need to know.” — Edin Alic, North Dakota State University Students easily access source code for example problems, as well as self-study materials and all the exercises and readings you assign All instructional materials, including PowerPoints, illustrations and visual tools, source code, exercises, solutions and gradebook organized in one easy-to-use system “WileyPLUS made it a lot easier to study I got an A!” — Student Jeremiah Ellis Mattson, North Dakota State University Big C++ SECOND EDITION Cay Horstmann SAN JOSE STATE UNIVERSITY Timothy A Budd OREGON STATE UNIVERSITY John Wiley & Sons, Inc EXECUTIVE PUBLISHER: ASSOCIATE PUBLISHER: SENIOR EDITORIAL ASSISTANT: MEDIA EDITOR: SENIOR PRODUCTION EDITOR: SENIOR DESIGNER: TEXT DESIGNER: COVER DESIGNER: COVER ILLUSTRATOR: PHOTO EDITOR: PRODUCTION MANAGEMENT: Don Fowley Dan Sayre Carolyn Weisman Lauren Sapira Ken Santor Madelyn Lesure Nancy Field Howard Grossman Susan Cyr Lisa Gee Cindy Johnson This book was set in 10.5/12 Stempel Garamond by Publishing Services and printed and bound by R.R Donnelley – Crawfordsville The cover was printed by R.R Donnelley This book is printed on acid-free paper ∞ Copyright © 2009, 2005 John Wiley & Sons, Inc All rights reserved No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600 Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley and Sons, Inc., 111 River Street, Hoboken, NJ 07030-5774, (201) 748-6011, fax (201) 748-6008 To order books, or for customer service, please call 1-800-CALL-Wiley (225-5945) ISBN 978-0-470-38328-5 Printed in the United States of America 10 Preface T his book provides a traditional introduction to computer science, focusing on program development and effective use of the C++ programming language It is suitable for motivated beginners as well as students with prior programming experience The book can be used in a variety of settings, such as an introductory computer science course, a two-semester course sequence that covers data structures and objectoriented design, or an advanced course on C++ and its applications When writing the book, we were guided by the following principles: • Teach computer science principles and not just C++ We use the C++ programming language as a vehicle for introducing computer science concepts, and in this “Big” book, we cover a large subset of the C++ language However, we not aim to cover all esoteric aspects of C++ This book focuses on the modern features of the C++ standard, such as the string class and the STL containers By minimizing the use of error-prone and confusing constructs, your students will learn more computer science and become more productive programmers • Use a spiral approach to teach complex topics We not think it is wise to overwhelm students when we introduce new topics Generally, we start with the essential facts that illustrate a concept, then cover technical details at a later time Here is an example For efficiency’s sake, large object parameters should be passed by constant reference, not by value But that consideration obscures more fundamental issues For that reason, we don’t use constant references when we first introduce classes In the next turn of the spiral, students are comfortable with classes and reference parameters, and a discussion of efficiency is appropriate We believe this spiral approach is essential when teaching a language as complex as C++ • Introduce C++ as an object-oriented language Objects are introduced in two stages From Chapter on, students learn to use objects—in particular, strings, streams, instances of the simple Time and Employee classes, and graphical shapes Students become comfortable with creating objects and calling member functions as the book continues along a traditional path, discussing and providing practice with control structures and functional decomposition In Chapter 5, vi Preface students learn how to implement classes and member functions From then on, objects and classes are used as the natural building blocks of computer programs • Keep the order flexible The book is highly modular Do you prefer to cover arrays before classes? Simply switch the chapters Do you want to cover streams and files earlier? This is not a problem We supply a graphics library, but it is entirely optional We have found that students enjoy programming exercises in which numbers and visual information reinforce each other But you may not want to spend class time on it Students can read the material on their own, or you can skip it altogether (See Figure on page viii for the chapter dependencies.) • Offer choices for advanced and applied topics This “Big” book contains so much material that it would be difficult to cover every chapter, even in an ambitious two-semester course The core material (Part A in Figure 1) contains what is typically covered in a one-semester introductory course: control structures, functions, arrays, classes, inheritance, and stream I/O The advanced material is grouped into four parts to make it easy to choose a focus that fits your course N e w in This Editio n Streamlined Core Chapters This edition has been reorganized to make it more suitable for a course that aims to cover advanced C++ features, data structures, or object-oriented design The introductory material has been condensed, and the material on control structures has been consolidated into a single chapter Modular Design The advanced chapters are now grouped into four distinct parts: • • • • Data structures and algorithms Advanced C++ and the STL Object-oriented design Applications Part B covers an introduction to data structures and algorithms, suitable for a second-semester programming course Part C focuses on advanced C++ and covers the STL in detail Part D covers object-oriented design, UML, and design patterns Finally, Part E (which is available on the Web) contains applied material on graphical user interface programming, databases, and XML that you may find useful as a capstone Except as shown in Figure 1, the parts are independent of each other The web-only chapters are part of the WileyPLUS eBook and may also be downloaded from the book’s web site at www.wiley.com/college/horstmann If you are interested in adopting a custom print edition that incorporates portions of the online material, please contact your local Wiley representative Preface vii Contemporary C++ This book continues to focus on the modern features of the C++ standard, such as the string class and the STL containers This edition prepares students for the future with a new Chapter 21 on the features of the upcoming C++0x standard (included in Part C) A large number of extended examples and 15 case studies show how C++ features are used in complete and useful programs Optional Graphics Programming The graphics programming coverage is provided because many students enjoy writing programs that create drawings, and because graphical shapes are splendid examples of objects However, this edition makes it easier to skip this focus if desired Chapter introduces the simple graphics library provided with this book as another type of object students may program with Thereafter, exercises that make use of the graphics library are clearly identified at chapter end An optional Chapter 25 covers graphical user interfaces and the wxWidgets library WileyPLUS The first two pages of this book describe an innovative online tool for teachers and students: WileyPLUS WileyPLUS can be adopted with the book, or as an alternative to the printed text for about half the cost of print WileyPLUS integrates all of the instructor and student web resources into an online version of this text For more information and a demo, please visit the web site listed on pages i–ii, or talk to your Wiley representative (To locate your local representative, visit www.wiley.com/ college and click on “Who’s My Rep”.) Student and Instructor Resources in WileyPLUS This edition offers enhanced electronic supplements In particular, the test bank has been completely revised to provide a significant number of multiple-choice questions that are suitable for self-check assignments and quizzes The following resources for students and instructors can be found in the WileyPLUS course for this book Web chapters and source code are also available on the Web at www.wiley.com/college/horstmann • • • • • Solutions to all exercises (for instructors only) A test bank (for instructors only) A laboratory manual Lecture slides that summarize each chapter and include code listings and figures Source code for all examples in the book, the Employee and Time classes, and the optional graphics library • The programming style guide (Appendix A) in modifiable electronic form • Help with common compilers, the graphics library, and wxWidgets viii Preface A A: Fundamentals Introduction B: Data Structures & Algorithms C: Advanced Topics & STL D: Object-Oriented Design Numbers and Objects E: Applications (web only) Control Flow Functions Vectors and Arrays Streams Classes E 26 Relational Databases Pointers Inheritance B C 10 Recursion 11 Sorting and Searching 12 Lists, Queues, & Stacks D 14 Operator Overloading 22 ObjectOriented Design 15 Memory Management 23 The Unified Modeling Language 13 Sets, Maps, & Priority Queues 16 Templates 24 Intro to Design Patterns 17 Exception Handling 18 Name Scope Management 20 The Standard Template Library 21 The C++0x Standard Figure Chapter Dependencies 19 Class Hierarchies 25 Graphical User Interfaces 27 XML 1042 Index (ch18), 720–722 (ch15), 630 matrixtest1.cpp (ch14), 585 matrixtest3.cpp (ch16), 661–662 matrixtest4.cpp (ch17), 692 matrixtest5.cpp (ch18), 723 matrix (two-dimensional array), 288–294 max_element function, 978 max_element generic algorithm, 786 max function, 978 and invalid type parameters, 645 max-heap, 529 maxval.cpp (ch09), 378–381 maxval2.cpp (ch09), 381–382 mean, 154 MEDIATOR pattern, 946t member class, 711 member function call, 64 calling without an object, 73 member functions, 237–240 accessors, 232 calling without an object, 73 C++/Java comparison, 1005, 1006 class scope, 700 comparing with nonmember, 250–253 encapsulation and name scope management, 698–699 file layout, 253 inheritance, 342 invoked on objects using dot notation, 63, 71–72 maps, 522 mutators, 232, 235, 236 nested classes, 711–712 operator functions, 548 operator member functions, 549–550 overriding, 349–356 private class implementation, 235 private data field access, 249 protected access, 355–356 protected name scope, 706 matrix5.h matrixtest.cpp pure virtual, 730 qualification, 702 sets, 507 source files have definitions, 253 subscript operator, 572 template classes, 651–652 this pointer, 311 in UML class diagrams, 876–877 use accessors for protected access to data, 708 memberwise assignment, 568 memberwise copy, 609 MEMENTO pattern, 946t memory, 4–5 See also dynamically allocated memory; heap code memory, 590–591 constructors, 602–631 destructors, 602 heap memory, 590, 593–594 run-time stack memory, 590, 592–593 static data memory, 590, 591 memory address, 307 memory allocation traits, 765 memory allocator, 306, 593 memory errors, 594 array bounds errors, 596–597 avoid buffer overflow errors, 597 deleting values more than once, 601 deleting values never allocated, 602 initialization errors, 594–595 invalid memory references, 600–601 lifetime errors, 595–596 object slicing, 597–599 memory leaks, 313, 599–600 memory management See also constructors; destructors assignment operators, 11–613 case study: matrices, 627–630 C++/Java comparison, 1009 and class auto_ptr, 620–622 constructors, 602–613 constructors are always extensions, 611 and constructors with arguments, 604–606 copy constructors, 608–609 default constructors, 606–607 destructors, 602, 613–622 explicitly under direction of programmer, 589 and field initializer lists, 610–612 if destructor, then copy constructor and assignment, 619–620 include virtual destructors, 618 not declaring destructors virtual, 617–618 observing constructors, 612–613 and operating systems, 365 overloading memory management operators, 621–622 reference counting, 622–627 self assignment, 626–627 single argument constructors have dual use, 605–606 tracing constructor execution, 616–617 memory management operators, overloading, 621–622 merge function, 976 and STL, 763t merge generic algorithm, 785 merge sort algorithm, 451–454 analysis, 454–457 mergesort.cpp (ch11), 452–454 Message class, 80, 982 Message constructor, 982 message.h (ch23), 896 message queues, 878 messages, 76, 77, 79, 80 methods, 1005 metric units, 51t Microsoft Windows, 183, 366 min_element function, 978 min_element generic algorithm, 786 function, 978 1043 Index mismatched iterators, 756 mismatch generic algorithm, 787 misspelling words, 21 ML language, 746, 747, 1004 monitor, 2, motherboard, mouse, move function, 982 using for graphical shapes, 77–78 Moving function, 985 multimap class summary, 977 using, 522–523 multimaps, 769–770 multiple inheritance, 736–743 avoid, 742–743 C++/Java comparison, 1007 multiple relational operators, 117–118 multiple threads of execution, 807 multiplicities of aggregation, 839 in UML class diagrams, 877 multiset class defining ordering for container elements, 508 summary, 976 using, 508 container library, 976 multiset (bag), 507–508 as associative containers, 767–769 defining ordering for container elements, 508 multitasking, 365 mutable keyword, 961t mutator functions, 232, 235, 236 mutual recursion, 425–429 Mycin, 120 mysql_close function, 987 mysql_free_result function, 987 library, 987 mysql_init function, 987 MySQL library, summary, 987 mysql_num_fetch_row function, 987 function, 987 function, 987 mysql_query function, 987 mysql_real_connect function, 987 mysql_store_result function, 987 mysql_num_fields mysql_num_rows N newline character, See newline escape sequence name collision, 699 name overloading, 245, 248 name scope management Case Study: Matrices, continued, 720–723 and encapsulation, 698–699 encapsulation management, 713–714 friends, 708–710 friendship is granted, not taken, 710 nested classes, 711–714 and private inheritance, 714–716 name scopes, 699–706 confusing with lifetime, 704–705 don’t pollute global scope, 703–704 forward references, 705–706 overriding, shading, and scopes, 702–703 protected, 706–708 shadows and qualification, 701–703 use accessors for protected access to data, 708 name space aliases, 718, 719 namespace keyword, 961t name spaces, 17, 716–719 local declaration, 719 to manage encapsulation, 713 use unambiguous names for, 719 namespace scope, 701, 704 naming conventions, style guide, 957–958 \n “3n +1” (Collatz) problem, 219 negation operators, 996t negator, 781 nested branches, 112–115 nested classes, 711–714, 742 and name scope management, 711–714 network card, networking, 366 networks, new keyword, 961t newline escape sequence \n, 17 summary, 967t new operator, 965t dynamically allocated arrays, 326–327 for inserting list nodes, 480 overloadable, 547t overloading and memory management, 621–622 should always have matching call to delete operator, 313 new[] operator, overloadable, 547t next function with iterators, 914 with list iterators, 478–479 next_permutation function, 979 next_permutation generic algorithm, 785 Nim, 156 nodes binary search trees, 509–516 binary trees, 509 dummy, 502 heaps, 529–539 inserting into linked lists, 480–484 in linked lists, 472–473, 477 removing from linked lists, 484–485 root node, 510 nonlinear control flow, 957 nonmember functions comparing with member, 250–253 comparison operators, 561 declaring in header files, 253 file layout, 253 1044 Index nonmember functions, continued operator functions, 549 source files have definitions, 253 nonmetric units, 51t normalize function, 557 nth_element function, 979 nth triangle numbers, 412 NULL pointers, 308 common uses for, 315 and deleting memory value more than once, 601 number systems, summary, 988–995 number types, 32–36 comparing, 105–108 numeric ranges and precision, 38–39t Pentium floating-point bug, 39–40 numerical integrator, numeric range, don’t use != to test the end of, 128–129 numeric ranges, 38–39 O object code, 22 object construction, 68–69 object-oriented design See also CRC cards; Unified Modeling Language case study: clock program educational game, 851–869 case study: invoice printing, 839–851 and cohesion, 833–835 and coupling, 835–836 and CRC cards, 831–833 implementing aggregations, 838–839 and relationships between classes, 837–838 software life cycle, 826–830 object-oriented programming, 11, 745 objects See also arrays; vectors in arrays, 280–282 C++/Java comparison, 1007–1008 classes, 227, 228–235 constructors for initializing data fields, 241 constructors with parameters, 244 employee objects, 74–76 encapsulation protects integrity of data, 236 and implementing aggregations, 839 inspecting in functions, 212 make parallel vectors into vectors of objects, 279–280 replacing with another, 70 in sets, 506 state, 235 state of, 235 throwing, 682 time objects, 68–73 trying to reset by calling constructor, 247 using, 68–76 in vectors, 265, 266–269 object slicing, 363 and memory errors, 597–599 object variables, 69, 70 OBSERVER pattern, 947t oct flag, 972 oct manipulator, 973 off-by-one errors, 124–125 ofstream class, 380 summary, 973 and TEMPLATE METHOD pattern, 922 ofstream variables, 376 one-character lookahead, 377 OnInit function, 983 open function class fstream, 973 class ifstream, 973 class ofstream, 973 operating systems, 183, 364–366 operator=, using, 759t operator[], using, 759t, 762 operator function, 548–549 deque class, 975 map class, 977 vector class, 974 operator keyword, 961t operator overloading, 248–249, 546–550 ambiguous conversions, 571–572 assignment operators, 568–569 avoid dependencies on order of evaluation, 565 binary arithmetic operators, 558–559 case study: fractional numbers, 551–557 case study: matrices, 577–585 comparison operators, 560– 561 compound assignment operators, 568 conversion, coercion, and casts, 570–571 conversion operators, 569–572 define one operator in terms of another, 568–569 and explicit keyword, 572 function call operator, 574–577 inconsistent operations, 566 increment and decrement operators, 564–567 inline functions, 576–577 input and output, 562–563 iterators and overloaded operators, 566–567 memory management operators, 621–622 only one level of conversion, 571 operator functions, 548–549 operator member functions, 549–550 other operators, 576 overloading memory management operators, 621–622 overload only to make programs easier to read, 559–560 peeking at the input, 563–564 as powerful and error-prone, 545 returning local objects, 559 1045 Index simple arithmetic operators, 558–560 stream input, 563 stream output, 562–563 subscript operator, 572–574 table of overloadable operators, 547t unary arithmetic operators, 560 operators, 546–547 and Polish notation, 496–497 summary, 964–966 table of overloadable, 547t OR Boolean operator, see || operator (OR) ordered vector, 278 ostream class, 378, 380 overloading stream output, 562–563 summary, 971 ostream_iterator, 792 ostream_iterator class, and ADAPTER pattern, 921 ostringstream class, 380 summary, 973 and TEMPLATE METHOD pattern, 922 out_of_range class, 678 summary, 980 output, 40–45

Ngày đăng: 18/05/2017, 10:55

TỪ KHÓA LIÊN QUAN

w