Learn C On The Macintosh 2nd Edition 1995
From the originals
13 scansMachine-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
DAVE MARK LEARN C ON THE MACINTOSH® SECOND EDITION Includes a Special Version of Metrowerks CodeWarrior™ Compiler
A book cover with a dark blue background, a copper-toned band at top bearing the author name DAVE MARK, a large white and brown stylized letter C, a red horizontal band, and a small compact disc graphic at lower right.
Reading notes: Line breaks between the large title words are inferred from layout; the title is stacked across the cover rather than set in a single line. Author name rendered in large dark letters on copper band; reading order top to bottom.
- Languages
- English
PDF page 1
Learn C on the Macintosh
DAVE MARK LEARN C ON THE MACINTOSH® SECOND EDITION Includes a Special Version of Metrowerks CodeWarrior™ Compiler
Book cover with a dark blue textured background, a large brown letter C with white and blue outline, a red horizontal band, a gold-tinted top band with the author name, and a compact disc icon at lower right.
Reading notes: The large C is a graphic letter; the 'ON THE' text sits inside the red band and the C is shown separately from 'LEARN' and 'MACINTOSH' in the layout.
- Languages
- English
PDF page 2
The image is a entirely blank white page with no visible artwork, layout, or text.
Reading notes: No visible text or graphics appear anywhere on the page; the image may be a blank scan or an empty page.
PDF page 3
Learn C on the Macintosh®
SECOND EDITION Learn C on the 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
- Printed product names
- Macintosh®
- Languages
- English
PDF page 4
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 capi- tal letters or all capital letters. The author and publisher have taken care in preparation of this book, but make no ex- pressed or implied warranty of any kind and assume no responsibility for errors or omis- sions. 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. Appendix E supplied courtesy of Metrowerks Corporation. Library of Congress Cataloging-in-Publication Data Mark, Dave. Learn C on the Macintosh I Dave Mark. - 2nd ed. p. cm. Includes bibliographical references and index. ISBN 0-201-48406-4 1. Macintosh (Computer)-Programming. 2. C (Computer program language) I. Title. QA76.8.M3M36771861995 005.265-dc20 95-23299 CIP Copyright© 1995 by Dave Mark All rights reserved. No part of this publication may be reproduced, stored in a retrieval sys- tem, 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: Martha Steffen Project Manager: John Fuller Production Coordinator: Ellen Savett Cover design: Andrew M. Newman Text design: Wilson Graphics and Design (Kenneth J. Wilson) Set in 10 point Palatino by Vicki L. Hochstedler 34567MA 00999897 3rd Printing November, 1997 Addison-Wesley books are available for bulk purchases by corporations, institutions, and other organizations. For more information please contact the Corporate, Government, and Special Sales Department at (800) 238-9682.
Reading notes: Printed date '1995' appears in multiple copyright and cataloging lines; distinct dates listed once in extraction OCR-style spacing irregularities in cataloging data such as 'QA76.8.M3M36771861995' and 'Library of Congress'
- Printed dates
- 1995 · 1997
- Languages
- English
PDF page 5
The image is a entirely blank white page with no visible artwork, layout elements, or text.
Reading notes: No visible text found in the image; transcript and printed fields left empty.
PDF page 6
--------------Contents Preface xi Acknowledgments xiii Chapter 1 Welcome Aboard 1 What's in the Package? 1 Why Learn C? 2 What Should You Know to Get Started? 2 What Equipment Will You Need? 3 The Lay of the Land 3 The Chapters 4 Conventions Used in This Book 5 Strap Yourself In . . . 6 Chapter 2 Installing and Testing CodeWarrior Lite 7 Installing CodeWarrior Lite 7 Testing CodeWarrior Lite 10 What's Next? 12 Chapter 3 Programming Basics 13 Reasons for Programming 13 Programming Languages 13 The Programming Process 16 Flavors of Object Code 21 What's Next? 23 vii
Reading notes: Source is a table of contents excerpt; no advertised products, prices, or dates are printed. Hyphenation and extra spacing in the copy may reflect extraction artifacts rather than original typography.
- Languages
- English
PDF page 7
CONTENTS viii Chapter 4 C Basics: Functions 25 C Functions 25 ISO C and the Standard Library 29 Same Program, Two Functions 31 Generating Some Errors 36 What's Next? 40 Exercises 40 Chapter 5 C Basics: Variables and Operators 43 An Introduction to Variables 43 Operators SO Operator Order 57 Sample Programs 60 Sprucing Up Your Code 71 What's Next? 75 Exercises 75 Chapter 6 Controlling Your Program's Flow 77 Flow Control 77 Expressions 79 Statements 86 Sample Programs 104 What's Next? 110 Exercises 111 Chapter 7 Pointers and Parameters 113 What Is a Pointer? 113 Pointer Basics 116 Function Parameters 122 What Do Parameters Have to Do with Pointers? 128 Global Variables and Function Returns 131
Reading notes: Source appears to be a table of contents rather than advertising copy; no headline or advertised products or prices identified Some spacing irregularities in chapter titles (e.g., 'Operator Order', 'Sprucing Up Your Code') may reflect extraction artifacts
- Languages
- English
PDF page 8
More Sample Programs 139 What's Next? 147 Exercises 147 Chapter a Variable Data Types 151 Other Data Types 151 Working with Characters 162 Arrays 168 Text Strings 177 #define 183 A Sample Program: wordCount 188 What's Next? 194 Exercises 194 Chapter 9 Designing Your Own Data Structures 197 Using Arrays (Model A) 197 Designing Data Structures (Model B) 209 Allocating Your Own Memory 223 Working with Linked Lists 228 What's Next? 241 Exercises 241 Chapter 10 Working with Files 243 What Is a File? 243 Working with Files, Part One 243 Working with Files, Part Two 252 Working with Files, Part Three 266 What's Next? 278 Exercises 278 CONTENTS ix
Reading notes: Source text is a table of contents with page numbers; no headline or advertised content is present. Some words are split by spacing and may need verification of exact spelling, e.g. 'Chapter a Variable Data Types' and 'Chapter 10'.
- Languages
- English
PDF page 9
CONTENTS x Chapter 11 Advanced Topics 281 What Is Typecasting? 281 Unions 285 Function Recursion 289 Binary Trees 293 Function Pointers 301 Initializers 303 The Remaining Operators 305 Creating Your Own Types 308 Static Variables 310 More on Strings 312 What's Next? 314 Exercises 314 Chapter 12 Where Do You Go from Here? 317 Appendixes The Macintosh Graphical User Interface 317 Useful Resources 322 Get On-line 324 Go Get 'Em 324 Appendix A AppendixB AppendixC AppendixD AppendixE AppendixF AppendixG Index 467 Glossary 325 Source Code Listings 337 CSyntax Summary 413 Selections from the Standard Library 417 About CodeWarrior . . . 447 Answers to Selected Exercises 459 Bibliography 465
Reading notes: Source appears to be a table of contents; no headline or advertised products present. Some entries contain irregular internal spacing in the extracted text.
- Languages
- English
PDF page 10
--------------Preface One of the best decisions I ever made was back in 1979 when I hooked up with my buddy Tom and learned C. At first, C was just a meaningless scribble of curly brackets, semicolons, and parentheses. Fortunately for me, Tom was a C guru, and with him looking over my shoulder, I learned C quickly. Now it's your tum. This time I'll be looking over your shoulder as you learn C. My goal is to pre- sent every aspect of C the way I would have liked it explained to me. I've saved up all the questions I had as I learned the language and tried to answer them here. Learning to program in C will open a wide range of opportunities for you. C is one of the most popular programming languages in the world today. Recessions may come and go, but there's always a demand for good C programmers. Whether you want to start your own software company or just write programs for your own enjoyment, you will discover that C programming is its own reward. Most of all, C programming is fun. I hope you enjoy the book. If you make it to MacWorld on either coast, stop by the Addison-Wesley booth and say hello. I'd love to hear from you. In the mean- time, tum the page, and let's get started.... D.M. Arlington, VA xi
Reading notes: Source appears to be a book preface; OCR spacing and line breaks are irregular (e.g., 'tum' for 'turn', 'In' capitalization).
- Printed dates
- 1979
- Languages
- English
PDF page 11
-----------Acknowledgments I 1 d like to take a paragraph or two and thank some people whose names didn't make the cover, but who made this book possible. First of all, I'd like to thank Keith Rollin, whose technical review made this book so much better. Thanks, Keith. I owe you big! Next, I'd like to thank all the folks at Addison-Wesley for their time, dedica- tion, and just plain hard work. People like Keith Wollman, Martha Steffen, Kaethin Prizer, John Fuller, and Ellen Savett do the work that gets this book from my Mac into your hands. Next, I'd like to thank Greg Galanos, Greg Dow, Berardino Baratta, Avi Rappaport, and the rest of the folks at Metrowerks for their support. Not only did they provide the copy of CodeWarrior you'll use to run all the examples in this book but they answered all my questions when Keith wasn't available. Thanks to Stu Mark who put together the CD in back of the book and alter- nated between bass, drums, and lead guitar to keep me from getting bored. Stu, I'm lucky to have you for a brother! A special thanks to Deneen and Daniel for letting me burn the midnight oil without complaint. And thanks to Hersh, Beth, Jackson, and Caroline Porter for being such great friends and neighbors. Finally, I'd like to thank the man who was there at the beginning, the man who introduced me to the wonders of C, my good friend Tom Swartz. Thanks, Tom. xiii
Reading notes: Page number '1' and 'xiii' appear as stray marks within the text; reading order may be uncertain.
- Printed product names
- CodeWarrior
- Languages
- English