ebook img

The Art of C++ by Herbert Schildt PDF

1058 Pages·2009·2.98 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview The Art of C++ by Herbert Schildt

C++: The Complete Reference, Fourth Edition About the Author Herbert Schildtistheworld’sleadingprogramming author.HeisanauthorityontheC,C++,Java,andC# languages,andisamasterWindowsprogrammer.His programmingbookshavesoldmorethan3million copiesworldwideandhavebeentranslatedintoall majorforeignlanguages.Heistheauthorofnumerous bestsellers,includingC++: TheComplete Reference, C#: The Complete Reference,Java 2: The Complete Reference, C: The CompleteReference,C++ from the Ground Up, C++: ABeginner’s Guide, C#: ABeginner’s Guide,and Java 2: ABeginner’s Guide. Schildt holds a master’s degree in computer science from the University of Illinois. He can be reached at his consulting office at (217) 586-4683. Copyright © 2003 by The McGraw-Hill Companies. Click here for terms of use. C++: The Complete Reference, Fourth Edition Herbert Schildt McGraw-Hill/Osborne New York Chicago San Francisco Lisbon London Madrid Mexico City Milan New Delhi San Juan Seoul Singapore Sydney Toronto Copyright © 2003 by The McGraw-Hill Companies. All rights reserved. Manufactured in the United States of America. Except as per- mitted under the United States Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the publisher. 0-07-150239-4 The material in this eBook also appears in the print version of this title: 0-07-222680-3. All trademarks are trademarks of their respective owners. Rather than put a trademark symbol after every occurrence of a trademarked name, we use names in an editorial fashion only, and to the benefit of the trademark owner, with no intention of infringement of the trademark. Where such designations appear in this book, they have been printed with initial caps. McGraw-Hill eBooks are available at special quantity discounts to use as premiums and sales promotions, or for use in corporate training programs. For more information, please contact George Hoare, Special Sales, at [email protected] or (212) 904-4069. TERMS OF USE This is a copyrighted work and The McGraw-Hill Companies, Inc. (“McGraw-Hill”) and its licensors reserve all rights in and to the work. Use of this work is subject to these terms. Except as permitted under the Copyright Act of 1976 and the right to store and retrieve one copy of the work, you may not decompile, disassemble, reverse engineer, reproduce, modify, create derivative works based upon, trans- mit, distribute, disseminate, sell, publish or sublicense the work or any part of it without McGraw-Hill’s prior consent. You may use the work for your own noncommercial and personal use; any other use of the work is strictly prohibited. Your right to use the work may be terminated if you fail to comply with these terms. THE WORK IS PROVIDED “AS IS.” McGRAW-HILL AND ITS LICENSORS MAKE NO GUARANTEES OR WARRANTIES AS TO THE ACCURACY, ADEQUACY OR COMPLETENESS OF OR RESULTS TO BE OBTAINED FROM USING THE WORK, INCLUDING ANY INFORMATION THAT CAN BE ACCESSED THROUGH THE WORK VIA HYPERLINK OR OTHERWISE, AND EXPRESSLY DISCLAIM ANY WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WAR- RANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. McGraw-Hill and its licensors do not warrant or guarantee that the functions contained in the work will meet your requirements or that its operation will be uninterrupted or error free. Neither McGraw-Hill nor its licensors shall be liable to you or anyone else for any inaccuracy, error or omission, regardless of cause, in the work or for any damages resulting therefrom. McGraw-Hill has no responsibility for the content of any information accessed through the work. Under no circumstances shall McGraw-Hill and/or its licensors be liable for any indirect, incidental, special, punitive, conse- quential or similar damages that result from the use of or inability to use the work, even if any of them has been advised of the possibil- ity of such damages. This limitation of liability shall apply to any claim or cause whatsoever whether such claim or cause arises in con- tract, tort or otherwise. DOI: 10.1036/0072226803 Professional Want to learn more? We hope you enjoy this McGraw-Hill eBook! If you’d like more information about this book, its author, or related books and websites, please click here. Contents at a Glance Part I The Foundation of C++: The C Subset 1 An Overview of C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2 Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3 Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 4 Arrays and Null-Terminated Strings . . . . . . . . . . . . . . . . 89 5 Pointers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 6 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 7 Structures, Unions, Enumerations, and User-Defined Types . . . . . . . . . . . . . . . . . . . . . . . . 161 8 C-Style Console I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 9 File I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 10 The Preprocessor and Comments . . . . . . . . . . . . . . . . . . 237 Part II C++ 11 An Overview of C++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255 12 Classes and Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289 v vi C++: The Complete Reference 13 Arrays, Pointers, References, and the Dynamic Allocation Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . 325 14 Function Overloading, Copy Constructors, and Default Arguments . . . . . . . . . . . . . . . . . . . . . . . . . 359 15 Operator Overloading . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383 16 Inheritance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417 17 Virtual Functions and Polymorphism . . . . . . . . . . . . . . . 443 18 Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459 19 Exception Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487 20 The C++ I/O System Basics . . . . . . . . . . . . . . . . . . . . . . . 509 21 C++ File I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539 22 Run-Time Type ID and the Casting Operators . . . . . . . 567 23 Namespaces, Conversion Functions, and Other Advanced Topics . . . . . . . . . . . . . . . . . . . . . 591 24 Introducing the Standard Template Library . . . . . . . . . . 629 Part III The Standard Function Library 25 The C-Based I/O Functions . . . . . . . . . . . . . . . . . . . . . . . 699 26 The String and Character Functions . . . . . . . . . . . . . . . . 723 27 The Mathematical Functions . . . . . . . . . . . . . . . . . . . . . . 737 28 Time, Date, and Localization Functions . . . . . . . . . . . . . 747 29 The Dynamic Allocation Functions . . . . . . . . . . . . . . . . . 757 30 Utility Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 761 31 The Wide-Character Functions . . . . . . . . . . . . . . . . . . . . . 775 Part IV The Standard C++ Class Library 32 The Standard C++ I/O Classes . . . . . . . . . . . . . . . . . . . . 787 33 The STLContainer Classes . . . . . . . . . . . . . . . . . . . . . . . . 811 34 The STLAlgorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 839 35 STLIterators, Allocators, and Function Objects . . . . . . 861 36 The String Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 881 37 The Numeric Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 897 38 Exception Handling and Miscellaneous Classes . . . . . . 925 Contents at a Glance vii Part V Applying C++ 39 Integrating New Classes: A Custom String Class . . . . . 935 40 Parsing Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 963 A The .NET Managed Extensions to C++ . . . . . . . . . . . . . . 999 B C++ and the Robotics Age . . . . . . . . . . . . . . . . . . . . . . . . 1005 Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1009 This page intentionally left blank

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.