C++ HOW TO PROGRAM
Introducing the New C++14 Standard
TENTH EDITION
Deitel Series Page
How To Program SeriesAndroid How to Program, 3/E
C++ How to Program, 10/E
C How to Program, 8/E
Java How to Program, Early Objects Version, 10/E
Java How to Program, Late Objects Version, 10/E
Internet & World Wide Web How to Program, 5/E
Visual Basic 2015 How to Program, 7/E
Visual C# 2015 How to Program, 6/E
Deitel Developer Series
Android 6 for Programmers: An App-Driven Approach, 3/E
C for Programmers with an Introduction to C11
C++11 for Programmers
C# 2015 for Programmers
iOS 8 for Programmers: An App-Driven Approach with Swift
Java for Programmers, 3/E
JavaScript for Programmers
Swift for Programmers
VitalSource Web Books
http://bit.ly/DeitelOnVitalSource
Android How to Program, 2/E and 3/E
C++ How to Program, 8/E and 9/E
Simply C++: An App-Driven Tutorial Approach
Java How to Program, 9/E and 10/E
Simply Visual Basic 2010: An App-Driven Approach, 4/E
Visual Basic 2012 How to Program, 6/E
Visual Basic 2015 How to Program, 7/E
Visual C# 2012 How to Program, 5/E
Visual C# 2015 How to Program, 6/E
LiveLessons Video Learning Products
http://deitel.com/books/LiveLessons/
Android 6 App Development Fundamentals, 3/e
C++ Fundamentals
Java Fundamentals, 2/e
C# 2012 Fundamentals
iOS 8 App Development Fundamentals with Swift, 3/e
JavaScript Fundamentals
Swift Fundamentals
To receive updates on Deitel publications, Resource Centers, training courses, partner offers and more, please join the Deitel communities on
Facebookhttp://facebook.com/DeitelFan
Twitterhttp://twitter.com/deitel
Google+http://google.com/+DeitelFan
YouTubehttp://youtube.com/DeitelTV
LinkedIn http://linkedin.com/company/deitel-&-associates
and register for the free Deitel Buzz Online e-mail newsletter at:
To communicate with the authors, send e-mail to:
or visit:
For continuing updates on Pearson/Deitel publications visit:
Visit the Deitel Resource Centers, which will help you master programming languages, software development, Android and iOS app development, and Internet- and web-related topics:
C++ How to Program
Introducing the New C++14 Standard
TENTH EDITION
Paul Deitel
Deitel & Associates, Inc.
Harvey Deitel
Deitel & Associates, Inc.
Boston Columbus Hoboken Indianapolis New York San Francisco Amsterdam Cape Town Dubai London Madrid Milan Munich Paris Montreal Toronto Delhi Mexico City So Paulo Sydney Hong Kong Seoul Singapore Taipei Tokyo
Vice President, Editorial Director: Marcia Horton
Acquisitions Editor: Tracy Johnson
Editorial Assistant: Kristy Alaura
VP of Marketing: Christy Lesko
Director of Field Marketing: Tim Galligan
Product Marketing Manager: Bram Van Kempen
Field Marketing Manager: Demetrius Hall
Marketing Assistant: Jon Bryant
Director of Product Management: Erin Gregg
Team Lead, Program and Project Management: Scott Disanno
Program Manager: Carole Snyder
Project Manager: Robert Engelhardt
Senior Specialist, Program Planning and Support: Maura Zaldivar-Garcia
Cover Art: Finevector / Shutterstock
Cover Design: Paul Deitel, Harvey Deitel, Chuti Prasertsith
R&P Manager: Rachel Youdelman
R&P Project Manager: Timothy Nicholls
Inventory Manager: Meredith Maresca
.
The authors and publisher of this book have used their best efforts in preparing this book. These efforts include the development, research, and testing of the theories and programs to determine their effectiveness. The authors and publisher make no warranty of any kind, expressed or implied, with regard to these programs or to the documentation contained in this book. The authors and publisher shall not be liable in any event for incidental or consequential damages in connection with, or arising out of, the furnishing, performance, or use of these programs.
2017 Pearson Education, Inc. Hoboken, New Jersey 07030
All rights reserved. Printed in the United States of America. This publication is protected by Copyright, and permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. To obtain permission(s) to use material from this work, please submit a written request to Pearson PLC, Permissions Department, 330 Hudson St, New York, NY 10013.
Many of the designations by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed in initial caps or all caps.
Library of Congress Cataloging-in-Publication Data on file.
10 9 8 7 6 5 4 3 2 1
ISBN-10: 0-13-444823-5
ISBN-13: 978-0-13-444823-7
In memory of Marvin Minsky, a founding father of the field of artificial intelligence.
It was a privilege to be your student in two graduate courses at M.I.T. Every lecture you gave inspired your students to think beyond limits.
Harvey Deitel
Trademarks
D eitel and the double-thumbs-up bug are registered trademarks of Deitel and Associates, Inc.
Carnegie Mellon Software Engineering Institute is a trademark of Carnegie Mellon University.
CERT is registered in the U.S. Patent and Trademark Office by Carnegie Mellon University.
UNIX is a registered trademark of The Open Group.
Microsoft and/or its respective suppliers make no representations about the suitability of the information contained in the documents and related graphics published as part of the services for any purpose. All such documents and related graphics are provided as is without warranty of any kind. Microsoft and/or its respective suppliers hereby disclaim all warranties and conditions with regard to this information, including all warranties and conditions of merchantability, whether express, implied or statutory, fitness for a particular purpose, title and non-infringement. In no event shall Microsoft and/or its respective suppliers be liable for any special, indirect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of information available from the services.