← Learn C on the Macintosh

Learn C on the Macintosh

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® SAN DIEGO PUBLIC LIBRARY 3 1336 04491 3748 INCLUDES SPECIAL VERSION OF SYMANTEC'S THINK C™ e upgrade ull version HINK C – inside for details Dave Mark

Book cover with dark navy background, large yellow 'Learn' and cyan 'Macintosh' title, a white stylized 'C' over a magenta lightning-like streak, a floppy disk icon, a San Diego Public Library barcode label, and a yellow corner sticker partly covered with text about an upgrade.

Reading notes: Yellow corner sticker text is cut off and only partially legible: 'e', 'upgrade', 'ull version', 'HINK C –', 'inside for details' with missing leading letters. Library label text 'SAN DIEGO PUBLIC LIBRARY' and barcode number are partly obscured by the barcode. Author name 'Dave Mark' is printed at bottom right in yellow.

Languages
English
PDF page 1

Learn C on the Macintosh® INCLUDES SPECIAL VERSION OF SYMANTEC'S THINK C™ Dave Mark SAN DIEGO PUBLIC LIBRARY 3 1336 04491 3748 e upgrade ull version HINK C – inside for details

A dark blue book cover with large yellow, cyan, and white title lettering, a pink lightning-like streak, a floppy disk icon, a library barcode label at top left, and a yellow corner band at lower left with partly cut-off text.

Reading notes: The yellow corner band text is cut off and partially visible: 'e', 'upgrade', 'ull version', 'HINK C –', and 'inside for details' are fragments, so the full wording is uncertain. The library barcode label text and number are visible but may be partially obscured. Reading order of the title lines is inferred from layout; 'Learn C' is set large with 'on the' in smaller italic cyan above 'Macintosh'.

Printed product names
Macintosh
Languages
English
PDF page 2

The image shows a blank white sheet framed by peach-colored corner pieces and a tan border, with a faint vertical fold line near the right edge and minor specks or smudges, and no visible printed text or artwork.

Reading notes: Faint smudges and a small mark near the center-left are not text.

PDF page 3

I Learn on the AD~ 69J ~ OOS,;Jfo5/MA WITHDR IX Macintosh INCLUDES SPECIAL VERSION OF SYMANTEC'S THINKC 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• Ta ipei J

Reading notes: Fragmentary OCR text with garbled characters such as 'AD~ 69J ~' and 'OOS,;Jfo5/MA' of uncertain reading Reading order of the book cover text is uncertain

Printed product names
Macintosh · THINKC
Printed dates
69J
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 capital 11! n. ~~ i~· ·~:l 1 d.' . t'" ' .. 11;; ( : . ... ;/. •·" ... . ·~ enet .. , ~· · "" ~~ · · ~ ~ '. 'li ~· ". '?t ~ . . :; \.~ . 'V l • . • ., ... r ~· ; ; i .. : tr:;: ·· · : '~. ·. ':f ,:'.!- -: ~r ~ > ~.; ~-'~~~1'~fw~;~$cmpdbrl~.'in Appendix D copyright© 1989 Symantec Corporation and used with permission. Library of Congress Cataloging-in-Publication Data Mark, Dave. Learn C on the Macintosh : includes special version of Symantec's Think C I Dave Mark. p. cm. Includes bibliographical references and index. ISBN 0-201-56785-7 1. Macintosh (Computer)-Programming. 2. C (Computer program language) I. Title. QA76.8.M3M36773 1991 005 .265-dc20 Copyright© 1991 by Dave Mark 91-15354 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 otherwi~~flwit~out the prior written permission of the publisher. Printed in the United States o~~~'iP,~li~Ji~ 1 d~te1f:lf ~w~~I~ i? Canada. ·T 1; 1 ~ 1,~' ·~.;.·1·/(. ·;J,1 ·:" .~ : . 1: f, -'·" ; ( :-: : . Sponsoring Editor: Julie Stillman Project Editor: Elizabeth G. Rogalin Cover design: Jean Seal Set in 11.5-point Sabon by ST Associates 1 2 3 4 5 6 7 8 9 -MW- 9594939291 First printing, August 1991 .'·-: .. , u

Reading notes: Garbled OCR characters in the trademark and copyright block Corrupted text around 'otherwi~~flwit~out' and the printing location line Scrambled characters in the middle section of the front matter

Printed product names
Think C
Printed dates
1989 · 1991 · 91-15354 · August 1991 · 1 2 3 4 5 6 7 8 9 -MW- 9594939291
Languages
English
PDF page 5

A completely blank white page with no visible artwork, layout elements, or text.

Reading notes: The image appears entirely blank; no visible text was found, so all printed fields are empty.

PDF page 6

A completely blank white page with no visible artwork, layout elements, or text.

Reading notes: The image appears entirely blank; no visible text was found, so all printed fields are empty.

PDF page 7

Preface vii 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 Will I Need? 5 The Lay of the Land 6 The Chapters 6 Conventions Used in This Book 7 Strap Yourself In . . . 8 Chapter 2 Installing THIN C 11 The Programming Process: A Quick Tour 14 Features of THIN C 20 What's Next? 22 v

Reading notes: Table of contents lists page numbers with irregular spacing; no primary heading is printed

Printed product names
THIN C
Languages
English
PDF page 8

vi Contents Chapter 3 Programming Basics Programming 28 How Computers Work THIN C and the Project File A Word About Memory The Importance of Binary What's Next? 40 Exercises 41 Chapter 4 C Basics: Functions C Functions 45 Function Calling Examples 28 33 35 39 49 The Most Important Function ANSI C and the Standard Library Same Program, Two Functions Generating Some Errors 56 What's Next? 59 Exercises 61 50 51 52 Chapter 5 C Basics: Variables and Operators An Introduction to Variables 66 Operators 71 Using Parentheses ( ) 78 Sample Programs 79 Sprucing Up Your Code 94 What's Next? 98 Exercises 99 25 43 63

Reading notes: Source appears to be a table of contents rather than an advertisement; no headline or advertised products present.

Languages
English
PDF page 9

Contents vii Chapter 6 Controlling Your Program's Flow 101 Flow Control 104 Expressions 106 Statements 114 Sample Programs 129 What's Next? 138 Exercises 139 Chapter 7 Pointers and Parameters 141 What is a Pointer? 144 Pointer Basics 148 Function Parameters 155 What Does All This Have to do with Pointers? 160 Global Variables and Function Returns 164 Sample Programs 172 What's Next? 181 Exercises 183 Chapter 8 Variable Data Types 185 Other Data Types 188 Working With Characters 192 Characters and C 193 The ASCII Character Set 194 Arrays 200 Why Use Arrays? 202 Danger, Will Robinson!!! 211 Text Strings 212 A Text String in Memory 213

Languages
English
PDF page 10

viii Contents The Input Buffer 216 On With the Program 219 The #define 2221 #define Macros 224 What's Next? 230 Exercises 231 Chapter 9 Designing Your Own Data Structures 233 Structures 236 Model A: Three Ways 236 Model B: The Data Structure Approach 240 Allocating Your Own Memory 248 Keep Track of That Address! 250 Working With Linked Lists 251 Order in the Code 268 What's Next? 269 Exercises 271 Chapter 10 Working With Files 273 What is a File? 276 Working with Files, Part One 276 Working with Files, Part Two 283 What's Next? 298 Exercises 299

Reading notes: Source appears to be a table of contents with inconsistent spacing; the heading '#define' is printed as '#define 2221' in one entry, which may be a page number run-on.

Languages
English
PDF page 11

Chapter 11 Filling in the Gaps What is Typecasting? 306 Unions 310 Function Recursion A Recursive Approach 314 316 Binary Trees 319 Function Pointers More on Strings What's Next? Exercises 335 328 330 333 Contents ix 303 Chapter 12 Adding the Macintosh Interface 339 The Macintosh User lnterface 342 The Graphical User Interface 342 Getting Started With the Mac Toolbox 346 Inside Macintosh 347 The Macintosh C Programming Primer 348 Macintosh Programming Secrets 349 Appendices 351 Appendix A Appendix B Appendix C Appendix D Appendix E Appendix F Appendix G Glossary 351 Complete Program Listings Syntax Reference Section Standard Library Functions The Complete THINK C Development Environment Answers to Selected Exercises Bibliography 441 361 401 405 423 435

Reading notes: Table of contents page numbers may be misaligned in the extracted reading order.

Languages
English