Using c++

Disponível somente no TrabalhosFeitos
  • Páginas : 53 (13076 palavras )
  • Download(s) : 0
  • Publicado : 6 de março de 2013
Ler documento completo
Amostra do texto
Object-Oriented
Programming
Using C++
Fourth Edition
Joyce Farrell

Australia • Brazil • Japan • Korea • Mexico • Singapore • Spain • United Kingdom • United States

Object-Oriented Programming
Using C++, Fourth Edition
Joyce Farrell
Executive Editor: Marie Lee
Acquisitions Editor: Amy Jollymore
Managing Editor: Tricia Coia
Developmental Editor: Lisa Ruffolo

© 2009 CourseTechnology, Cengage Learning
ALL RIGHTS RESERVED. No part of this work covered by the copyright
herein may be reproduced, transmitted, stored or used in any form or by
any means—graphic, electronic, or mechanical, including but not limited
to photocopying, recording, scanning, digitizing, taping, Web distribution,
information networks, or information storage and retrieval systems, except
aspermitted under Section 107 or 108 of the 1976 United States
Copyright Act—without the prior written permission of the publisher.

Editorial Assistant: Patrick Frank
For product information and technology assistance, contact us at
Cengage Learning Customer & Sales Support, 1-800-354-9706

Marketing Manager: Bryant Chrzan
Content Project Manager: Erin Dowler

For permission to use materialfrom this text or product,
submit all requests online at cengage.com/permissions
Further permissions questions can be e-mailed to
permissionrequest@cengage.com

Art Director: Bruce Bond
Manufacturing Coordinator:
Julio Esperas
Proofreader: Wendy Benedetto
Cover Designer: Bruce Bond
Cover Photo: © iStockphoto.com/
Storman
Compositor: International Typesetting
and Composition

ISBN-13:978-1-4239-0257-7
ISBN-10: 1-4239-0257-2
Course Technology
25 Thomson Place
Boston, MA 02210
USA
Cengage Learning is a leading provider of customized learning solutions with
office locations around the globe, including Singapore, the United Kingdom,
Australia, Mexico, Brazil, and Japan. Locate your local office at:
international.cengage.com/region
Cengage Learning products are representedin Canada by Nelson
Education, Ltd.
For your lifelong learning solutions, visit course.cengage.com
Purchase any of our products at your local college store or at our
preferred online store www.ichapters.com
Some of the product names and company names used in this book have
been used for identification purposes only and may be trademarks or
registered trademarks of their respectivemanufacturers and sellers.
Course Technology, a part of Cengage Learning, reserves the right to
revise this publication and make changes from time to time in its content
without notice.

Printed in the United States of America
1 2 3 4 5 6 7 12 11 10 09 08

BRIEF CONTENTS
PREFACE

xvii

READ THIS BEFORE YOU BEGIN

xxi

CHAPTER 1 AN OVERVIEW OF OBJECT-ORIENTED PROGRAMMING
AND C++

1CHAPTER 2 EVALUATING C++ EXPRESSIONS

51

CHAPTER 3 MAKING DECISIONS

81

CHAPTER 4 PERFORMING LOOPS

123

CHAPTER 5 UNDERSTANDING ARRAYS, STRINGS, AND POINTERS

165

CHAPTER 6 USING C++ FUNCTIONS

223

CHAPTER 7 USING CLASSES

283

CHAPTER 8 CLASS FEATURES AND DESIGN ISSUES

333

CHAPTER 9 UNDERSTANDING FRIENDS AND OVERLOADING OPERATORS

385

CHAPTER 10UNDERSTANDING INHERITANCE

451

CHAPTER 11 USING TEMPLATES

501

CHAPTER 12 HANDLING EXCEPTIONS

557

CHAPTER 13 ADVANCED INPUT AND OUTPUT

615

CHAPTER 14 ADVANCED TOPICS

673

APPENDIX A GETTING STARTED WITH MICROSOFT VISUAL STUDIO 2008

731

APPENDIX B GETTING STARTED WITH OTHER C++ COMPILERS

737

APPENDIX C OPERATOR PRECEDENCE AND ASSOCIATIVITY

745

APPENDIX D FORMATTINGOUTPUT

749

APPENDIX E GENERATING RANDOM NUMBERS

755

GLOSSARY

761

INDEX

777
iii

This page intentionally left blank

CONTENTS
PREFACE

xvii

READ THIS BEFORE YOU BEGIN

xxi

CHAPTER 1 AN OVERVIEW OF OBJECT-ORIENTED PROGRAMMING
AND C++

1

THE TASK OF PROGRAMMING

2

PROGRAMMING UNIVERSALS

3

PROCEDURAL PROGRAMMING
Early Procedural Programs...
tracking img