Introduction to Programming with C++(3rd) 英文无水印pdf 第3版 pdf所有页面使用FoxitReader和PDF-XChangeViewer测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除C++ Quick Referenceif Statementsswitch statementsArray/Initializerf (condition)switch (intExpression)int list[10]int1ist[]={1,2,3,4};statementscase value1statements:Multidimensional Array/Initializerbreakint1ist[10][15];if (condition)case valuenint1ist[2][2]={{1,2},{statements;statements;break;defaultic Memory Creation/Deletionelsestatements;int* pl= new int;statementsint* p2= new int[10]delete pldelete [ p2:f (condition1)statements;Frequently Used functionselse if (condition 2)time (o)returns current timesrand (seed) sets a new seed for generating random numbersstatements;randoreturns a random integerpow ca, b)returns aelseCharacter functionsstatementssdigit(c) returns true if c is a digitisalpha(c) returns true if c is a letter.isalnum(returns true if c is a letter or a digitislower(c) returns true if c is a lowercase letterisupper(c) returns true if c is an uppercase letterto lower(c) returns a lowercase for ctoupper(c) returns an uppercase for cLoop StatementsC-String Functionswhile (condition)strlenreturns string lengthstatements;strcpycopies a stringstrcatconcatenate two stringsstrcmpcompares two stringsdoatolconverts a string to a long valuetoaconverts a an Integer a stringstatements;he string class Member Functionsf while (condition)appendappends new contents to the stringfor (init: conditionInsertinserts new contents to the stringadjustment)atretrieves character from the stringstring subscript operatorstatementslengthreturns the length of the stringsubstrreturns a substring from the stringCompanionWebsitewww.cs.armstrongedu/liang/cpp3eONLINE ACCESSThank you for purchasing a new copy of Introduction to Programming with C++, Third EditionYour textbook includes six months of prepaid access to the book's companion Website. Thisprepaid subscription provides you with full access to the following student support areasVideonotesWeb ChaptersStudent supplementsUse a coin to scratch off the coating and reveal your student access code.Do not use a knife or other sharp object as it may damage the codeo access the Introduction to Programming with C++, Third Edition, Companion Website for the firsttime, you will need to register online using a computer with an Internet connection and a webbrowser. The process takes just a couple of minutes and only needs to be completed once1.Gotowww.pearsoninternationaleditions.com/iang2. Click on Companion Website3. Click on the Register button4. On the registration page, enter your student access code* found beneath the scratch-off panelDo not type the dashes. You can use lower-or uppercase5. Follow the on-screen instructions. If you need help at any time during the online registrationprocess, simply click the Need Help? icon6. Once your personal Login Name and Password are confirmed, you can begin using theIntroduction to Programming with C++ Companion Website!To log in after you have registeredYou only need to register for this Companion Website once. After that, you can log in any time atwww.pearsoninternationaleditions.com/iangbyprovidingyourLoginNameandPasswordwhenpromptedImportant: The access code can only be used once. This subscription is valid for six monthsupon activation and is not transferable. If this access code has already been revealed, it may nolonger be validC++ Quick Referenceif Statementsswitch statementsArray/Initializerf (condition)switch (intExpression)int list[10]int1ist[]={1,2,3,4};statementscase value1statements:Multidimensional Array/Initializerbreakint1ist[10][15];if (condition)case valuenint1ist[2][2]={{1,2},{statements;statements;break;defaultic Memory Creation/Deletionelsestatements;int* pl= new int;statementsint* p2= new int[10]delete pldelete [ p2:f (condition1)statements;Frequently Used functionselse if (condition 2)time (o)returns current timesrand (seed) sets a new seed for generating random numbersstatements;randoreturns a random integerpow ca, b)returns aelseCharacter functionsstatementssdigit(c) returns true if c is a digitisalpha(c) returns true if c is a letter.isalnum(returns true if c is a letter or a digitislower(c) returns true if c is a lowercase letterisupper(c) returns true if c is an uppercase letterto lower(c) returns a lowercase for ctoupper(c) returns an uppercase for cLoop StatementsC-String Functionswhile (condition)strlenreturns string lengthstatements;strcpycopies a stringstrcatconcatenate two stringsstrcmpcompares two stringsdoatolconverts a string to a long valuetoaconverts a an Integer a stringstatements;he string class Member Functionsf while (condition)appendappends new contents to the stringfor (init: conditionInsertinserts new contents to the stringadjustment)atretrieves character from the stringstring subscript operatorstatementslengthreturns the length of the stringsubstrreturns a substring from the stringCompanionWebsitewww.cs.armstrongedu/liang/cpp3eget with the programmingThrough the power of practice and immediate personalizedfeedback, My ProgrammingLab improves your performanceInternational Edition contributions byAnisha sharmaMyProgrammingLabLearnmoreatwww.myprogramminglab.comALWAYS LEARNINGPEARSONThis page intentionally left blankINTRODUCTION TOPROGRAMMINGWITHThird editionInternational Edition contributions byMohit p. tahilianiNITK SurathkalY. Daniel LiangArmstrong Atlantic State UniversityPEARSONUpper Saddle river Boston Columbus San Francisco New YorkIndianapolis London Toronto Sydney Singapore Tokyo MontrealDubai Madrid Hong Kong Mexico City Munich Paris Amsterdam Cape TownEditorial director: marcia hortonAcquisitions Editor, International Edition: Sandhya GhoshalExecutive Editor: Tracy JohnsonPublishing administrator. International edition: Hema mehtaAssociate Editor: Carole SnyderProject Editor, International Edition: Karthik SubramanianEditorial assistant: Jenah Blitz- StochOperations supervisor: Nick sklitsisDirector of Marketing: Christy leskoManufacturing Buyer: Lisa McDowellMarketing Manager: Ycz AlayanArt Director: Anthony GcmmcllaroMarketing Coordinator: Kathryn FerrantiText and Cover Designer: Anthony GiemmellaroDirector of Production: Erin greManager. visual research: Karen sanatarManaging Editor: Scott DisannoManager, Rights and Permissions: Michael JoyceProduction Project Manager: Kayla Smith- TarboxText Permission Coordinator: Brian WysockPublisher. International Edition: Angshuman ChakrabortyCover Art: Tetra Images/Glow imagesPublishing Administrator and Business Analyst,Lead Media Project Manager: Renata BueteraIntermational edition Shokhi shah KhandelwalFull-Scrvice Project Managcment: LascrwordsAssociate print and media editor. International editiorCover Printer: Lehigh-Phoenix Color/HagerstownAnuprova Dey ChowdhuriPearson Education limitedEdinburgh gateHarlowEssex cm20 2JEEnglandand Associated Companies throughout the worldVisit us on the world wide web atwww.pearsoninternationaleditions.comO Pearson Education limited 2014The rights of Y. Daniel liang to be identified as author of this work have been asserted by him in accordance with the Copyright, Designs and Patents Act 1988Authorized adaptation from the United States edition, entitled Introduction to Programming With C++, Third Edition, ISBN 978-0-13-325281-1,byY. Daniel Liang, published by pearson education 2014All 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 or otherwise, without either the prior written permission of the publisher or a license permitting restricted copying inthe United Kingdom issued by the Copyright Licensing Agency Ltd, Saffron House, 6-10 Kirby Street, London ECIN STSAll trademarks used herein are the property of their respective owners. The use of any trademark in thistext does not vest in the author or publisher any trademark owrrights in such trademarks, nor doesthe use of such trademarks imply any affiliation with or endorsement of this book by such ownersMicrosoft and/or its respective suppliers make no representations about the suitability of the information contained in the documents and related graphicspublished 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/orits respective suppliers hereby disclaim all warranties and conditions with regard to this information, including all warranties and conditions of merchantabilitywhether express, implied or statutory, fitness for a particular purpose, title and non-infringement. In no event shall Microsoft and/or its respective suppliers beliable 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 servicesThe documents and related graphics contained herein could include technical inaccuracies or typographical errors. Changes are periodically added to the in-formation herein. Microsoft and/or its respective suppliers may make improvements and/or changes in the product(s) and/or the program(s)described hereinat any timc Partial screen shots may be viewed in full within the software version spccificdMicrosoft@ and windows@ are registered trademarks of the Microsoft Corporation in the U.S.A. and other countries. This book is not sponsored or endosed by or affiliated with the Microsoft CorporationISBN10:0-273-79324-1ISBN13:9780-273-79324-3British Library Cataloguing-in-Publication Dataa catalogue record for this book is available from the british librar109876543211413121110Typeset in Times by LaserwordsPrinted and bound by Courier Kendalville in The United States of AmericaThe publisher's policy is to use paper manufactured from sustainable forestsPEARSONThis book is dedicated to my current and former C++students. You have inspired and helped meto continue to improve this bookTo Samantha. Michael and michelle