← Learn C++ On the Macintosh 1993

Learn C++ On the Macintosh 1993

From the originals

13 scans

Machine-transcribed text and image descriptions. Check the linked original for uncertain words or fine print.

These are transcribed pages from the documents, not the full publications. Open the original for the remaining pages.

Image 1

Learn C++ on the Macintosh® INCLUDES SPECIAL VERSION OF SYMANTEC C++ FOR MACINTOSH Dave Mark upgrade to full version of Symantec C++ for Macintosh—see inside for details

A dark teal book cover with large italic title text in teal, magenta, and yellow, a stylized white C++ logo over a magenta brush stroke, a floppy disk icon, and a yellow corner sticker at lower left.

Reading notes: Lower-left yellow corner sticker is cut off at the edge; text reads 'upgrade', 'll version', 'ymantec C++', 'Macintosh—', 'nside for details' and the full wording is inferred from the partial fragments, so the reconstructed 'upgrade to full version' is uncertain. The ® symbol after Macintosh is a registered-trademark mark and is transcribed as shown. Title and author are set in large stylized type; reading order follows title, subtitle, author.

Printed product names
Symantec C++ for Macintosh
Languages
English
PDF page 1

Learn C++ on the Macintosh® INCLUDES SPECIAL VERSION OF SYMANTEC C++ FOR MACINTOSH Dave Mark pgrade ll version ymantec C++ Macintosh— nside for details

A dark teal book cover with large stylized title text in teal, magenta and yellow, a white stylized C++ logo with a magenta slash, a floppy disk icon, and a yellow corner sticker at lower left.

Reading notes: Yellow corner sticker at lower left is cut off; visible fragments read 'pgrade', 'll version', 'ymantec C++', 'Macintosh—' and 'nside for details' and the missing letters were not inferred. The ® after Macintosh is a registration mark, included as printed.

Printed product names
Symantec C++ for Macintosh
Languages
English
PDF page 2

Learn Mac to sh®

Learn Mac to sh® INCLUDES SPECIAL VERSION OF SYMANTEC C++ FOR MACINTOSH Dave Mark ... TT Addison-Wesley Publishing Company Reading, Massachusetts • Menlo Park, California • New York Don Mills, Ontario • Wokingham , England • Amsterdam Bonn • Sydney • Singapore • Tokyo • Madrid • San Juan Paris • Seoul • Milan • Mexico City • Taipei

Reading notes: Headline spacing and the ® symbol in the title are irregular in the extracted text.

Printed product names
Symantec C++
Languages
English
PDF page 3

Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and Addison- Wesley was aware of a trademark claim, the designations have been printed in initial capital letters. The authors and publishers have taken care in preparation of this book and software package, but make no expressed or implied warranty of any kind and assume no responsi- bility for errors orornissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein. Library of Congress Cataloging-in-Publication Data Mark, Dave. Learn C++ on the Macintosh: includes a special version of Symantec's C++ compiler I Dave Mark. p. cm. Includes bibliographical references and index. ISBN 0-201-62204-1 1. Macintosh (Computer)--Prograrnrning. language) I. Title. QA76.8.M3M36772 1993 005.26'2--dc20 Copyright © 1993 by Dave Mark 2. C++ (Computer program 93-61 CIP 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, or otherwise, without the prior written permission of the publisher. Printed in the United States of America. Published simultaneously in Canada. Sponsoring Editor: Keith Wollman Project Editor: Elizabeth G. Rogalin Production Coordinator: Gail McDonald Jordan Cover design: Jean Seal Icons in book designed by Crystal Sarno, Graphic Perspectives, Inc. Set in 11 point Palatino by Rob Mauhar and Lenity Himburg, CIP 123 4 5 6 7 8 9 -MA- 9796959493 First printing, June 1993

Reading notes: OCR damage in bibliographic data, e.g. 'Prograrnrning' and 'orornissions' Garbled CIP block line order Heading text 'Learn C++ on the Macintosh' treated as no primary heading in the supplied copy

Printed product names
Symantec's C++ compiler
Printed dates
1993 · June 1993
Languages
English
PDF page 4

To the rest of the quadrangle: Daniel, Deneen, and Stu. See you all New Year's Eve!

A mostly blank white card page with three lines of italic black serif handwriting-style text in the upper-middle area, the middle line indented to the right.

Reading notes: Headline is absent; the text is a short greeting rather than a titled advertisement. The apostrophe in "New Year's" appears as a typographic apostrophe; 'New Year's Eve' is not a numeric date.

Printed dates
New Year's Eve
Languages
English
PDF page 5

Preface zx Acknowledgments xz Chapter 1 Welcome Aboard 1 What's in the Package? 3 Why Learn C++? 4 What Should I Know to Get Started? 4 What Equipment Do I Need? 5 The Lay of the Land 5 Strap Yourself In... 8 Chapter 2 Installing THIN C++ 9 Installing THIN C++ 12 Testing THIN C++ 13 Features of THIN C++ 16 Summary 19 Chapter 3 Remembering C 21 Literal Constants 24 Variables 28 Operators 37 Statements 42 v

Reading notes: Table of contents layout with page numbers; some page numbers and spacing are irregular.

Printed product names
THIN C++
Languages
English
PDF page 6

vi Contents Functions 43 Preprocessor Directives 44 Comments 45 Summary 45 Chapter 4 Introducing C++ 47 Getting C Code to Run under C++ 50 New Features of C++ 54 The II Comment Marker 54 Handling Input and Output 55 Default Argument Initializers 64 Reference Variables 68 Function Name Overloading 75 The new and delete Operators 79 The Scope Operator 85 lnline Functions 88 Summary 91 Chapter 5 Object Programming Basics 93 The Organizational Power of the Struct 96 Bundling Data and Functions 97 Creating an Object 98 Accessing an Object's Data Members and Member Functions 100 Deleting an Object 103 Writing Class Functions 104 Access Priveleges 111 Bringing It All Together 114 The friends Mechanism 119 Summary 126

Reading notes: Source appears to be a table of contents; no headline, products, prices or dates are present. Some OCR spacing irregularities in heading text (e.g., 'The II Comment Marker', 'Access Priveleges') may need verification against the original.

Languages
English
PDF page 7

Contents vii Chapter 6 Derived Classes 131 Inheritance 134 Derivation, Constructors, and Destructors 141 Base Classes and Constructors with Parameters 147 Overriding Member Functions 154 Summary 158 Chapter 7 Operator Overloading The Operator Overloading Alternative 165 A Few Restrictions 173 Covering All the Bases 174 Special Cases 183 Summary 204 Chapter 8 Inside iostream The Character-Based Interface 208 The iostream Classes 208 Working with Files 216 The iostream State Bits 220 More File Info 226 Customizing iostream Formatting Your Output 228 234 Using Manipulators 240 istrstream and ostrstream 241 Summary 244 Chapter 9 C++ Potpourri Templates 248 The Templates Approach 249 161 205 245

Reading notes: Source is a table of contents; no headline or advertised products or prices present. Some chapter page numbers appear out of order in the extracted text, so reading order may be uncertain.

Languages
English
PDF page 8

viii Contents Multiple Inheritance 260 Resolving Ambiguities 270 Initialization Versus Assignment 280 Memberwise Initialization 284 Summary 292 Chapter 10 Moving On 293 Appendices The User Interface 295 The Macintosh Toolbox 297 Class Libraries 299 Books and Other Reference Material 301 Go Get 'Em... 305 Appendix A Appendix B Appendix C Appendix D Appendix E Appendix F Appendix G Appendix H Appendix I Glossary 307 Source Code Listings 313 fstream.h 351 iomanip.h 359 iostream.h 361 strstrea.h 385 Unoffical C++ Style Guide The Complete Symantec C++ Development Environment Bibliography 439 391 429

Reading notes: Table of contents page; no primary headline identified Page numbers and some entries may be partially ambiguous in reading order

Printed product names
Symantec C++ · Development Environment
Languages
English
PDF page 9

Some time ago, back in 1988 or 1989, I remember reading an article written by someone at Apple Computer. The article was addressed to all Macintosh pro- grammers, and spoke to the future of Macintosh software development. Back then, the vast majority of Macintosh programs were written in either C or Pascal. Sure, there might have been a little Basic here, and a little C++ there, but those languages were viewed as the fringe-a definite minority. Anyway, this article went on to describe the wonders of object programming and of C++ in particular. Normally, I would have turned the page, since I was perfectly happy programming in C and Pascal, my personal languages of choice. But this article quickly captured my attention. As I read, I began to realize something basic was happening. This article wasn't just an interesting discus- sion of an alternative development methodology. It was a warning shot across my bow. Apple was making a real commitment to object programming and to C++. At development conferences, the message was also becoming clear. Apple expected all Macintosh software developers not just to understand, but to em- brace object programming. Pay attention to this message: Object programming is the future, and C++ is the language for object programming. Why C++? Apple rewrote MacApp (their object development library) entirely in C++. Apple rewrote much of their operat- ing system in C++. When Symantec and Apple announced their joint cross- platform development library, Bedrock, they made it clear that Bedrock would be written entirely in C++. Once you've made the commitment to learn about object programming and C++, you're ready to take the next step. Bring this book home with you (pay for it first) and start reading. Learn C++ on the Macintosh will do the rest. By the way, if you feel like getting in touch, I'd love to hear from you. Get on CompuServe, type GO MA CD EV, and leave a message in the Learn Programming section (section 11). In the meantime, let's get started ... D.M. Arlington, Virginia ix

Reading notes: Headline not clearly identified in the supplied copy; the book title 'Learn C++ on the Macintosh' appears in body text only.

Printed product names
MacApp · Bedrock · CompuServe · Learn C++ on the Macintosh
Printed dates
1988 · 1989
Languages
English
PDF page 10

I'd like to take a few moments to thank all the people who made this book possible. First and foremost, I'd like to thank my good friend Steve Baker. His programming experience and C ++ expertise provided invaluable assistance. Steve put in a lot of long hours helping to put this book together. Whether he was fine tuning the table of contents or tinkering with one of my C++ sample programs, Steve's heart and soul were poured into this book. By the way, thanks also to Steve's family, Kelly, Michael, and Matthew, for patience and understand- ing above and beyond the call of duty. Thanks to Elizabeth Rogalin, my friend, confidante, and project editor, for seeing this book through. Thanks, Elizabeth! Thanks to Steve Bushell and Jaime Jouris at Symantec for putting together THIN C++ and for answering all my questions. Thanks to Dan Weston, C++ guru extraordinaire, for his awesome tech review. Dan helped keep this book on the straight and narrow path to C++ correctness. Thanks to my old pal Julie Stillman up in Vermont. Happy birthday to you! Wish I could have been there. Thanks to Crystal Sarno for her excellent artwork. Crystal designed the icons sprinkled throughout the book. Thanks to Jean Peck for an incredible job copyediting the book. Thanks to Carlos Derr for guidance and friendship. Finally, thanks to Deneen Joanne Melander, for companionship, love, and understanding. LFUEMISOK? xi

Reading notes: Closing line 'LFUEMISOK?' is unclear and may be a damaged or encoded fragment Spacing in 'C ++' may be an OCR artifact

Printed product names
THIN C++
Languages
English
PDF page 11

Chapter 1 Interested in learning how to program in C++? Well, you've come to the right place. Grab your Mac, hop into your most comfortable chair, and read on... '. ' 1

Reading notes: Source text is a fragment with a chapter label and no primary heading; headline set to null. Trailing stray marks ('.', ''', '1') are of uncertain significance.

Languages
English