# Learn C on the Macintosh — source transcripts, page 1

[Canonical transcript page](https://www.vintageapple.net/transcripts/media/va-learn-c-on-the-macintosh-1989-506162/1)

## Transcribed source material

Machine transcriptions and image descriptions; uncertain copy may be marked [illegible]. Verify against the linked originals. Historical rights remain with the original owners.

These are transcribed excerpts, not the full publications. Open the originals for remaining pages.

### Image 1

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-learn-c-on-the-macintosh-1989-506162/1#scan-9fa72a5c3b3a1ff6e8f60c56914076140f8d2a45563d33f8eec82b75b0e1bd23)

Transcribed text:

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

Image description: 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

[Original Image 1](https://www.vintageapple.net/files/695b29e926b6be551a903d5012aa280d7f05e3870d9882821fd51c8eb47c0c5a/447193c600a7a9269b808afd.webp)

### PDF page 1

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-learn-c-on-the-macintosh-1989-506162/1#scan-1e649ca488bf210dd2f1c506f771f5211465f92b97eee6367b977e621470c092)

Transcribed text:

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

Image description: 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

[Original PDF page 1](https://www.vintageapple.net/files/c2d541ab127ef32549202300089c0f172523dfb92af5224c2d1ef0eabd6c68f1/Learn_C_on_the_Macintosh_1989.pdf#page=1)

### PDF page 2

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-learn-c-on-the-macintosh-1989-506162/1#scan-902d6b7de2525a623c7852cbf7b7a3ec438ae3a420391820b717239a70a96755)

Image description: 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.

[Original PDF page 2](https://www.vintageapple.net/files/c2d541ab127ef32549202300089c0f172523dfb92af5224c2d1ef0eabd6c68f1/Learn_C_on_the_Macintosh_1989.pdf#page=2)

### PDF page 3

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-learn-c-on-the-macintosh-1989-506162/1#scan-1fe54573b01a7cca1e3f8be9a75941e3d907d42cb8526f4f45e5406d9b6699a5)

Transcribed text:

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

[Original PDF page 3](https://www.vintageapple.net/files/c2d541ab127ef32549202300089c0f172523dfb92af5224c2d1ef0eabd6c68f1/Learn_C_on_the_Macintosh_1989.pdf#page=3)

### PDF page 4

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-learn-c-on-the-macintosh-1989-506162/1#scan-e82145f34204126ad78d6efdb831d36730e04e0d1c8d1278b95f5e4cc4e7915e)

Transcribed text:

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

[Original PDF page 4](https://www.vintageapple.net/files/c2d541ab127ef32549202300089c0f172523dfb92af5224c2d1ef0eabd6c68f1/Learn_C_on_the_Macintosh_1989.pdf#page=4)

### PDF page 5

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-learn-c-on-the-macintosh-1989-506162/1#scan-2bbab83a8b1ec27efdff3bd4efdb6d1fb2fe2196acafa9a9ec0ac4b0921a2e2f)

Image description: 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.

[Original PDF page 5](https://www.vintageapple.net/files/c2d541ab127ef32549202300089c0f172523dfb92af5224c2d1ef0eabd6c68f1/Learn_C_on_the_Macintosh_1989.pdf#page=5)

### PDF page 6

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-learn-c-on-the-macintosh-1989-506162/1#scan-654acbb9686357a655852bd391a4f8944a04b719b766dac8240870f8d9ccb799)

Image description: 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.

[Original PDF page 6](https://www.vintageapple.net/files/c2d541ab127ef32549202300089c0f172523dfb92af5224c2d1ef0eabd6c68f1/Learn_C_on_the_Macintosh_1989.pdf#page=6)

### PDF page 7

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-learn-c-on-the-macintosh-1989-506162/1#scan-3813b639f94be95d653b3f8257062bf26778b3764cb131881216eda5b3874421)

Transcribed text:

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

[Original PDF page 7](https://www.vintageapple.net/files/c2d541ab127ef32549202300089c0f172523dfb92af5224c2d1ef0eabd6c68f1/Learn_C_on_the_Macintosh_1989.pdf#page=7)

### PDF page 8

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-learn-c-on-the-macintosh-1989-506162/1#scan-559a335eb0b3c855d181d3f36cc442301945b856bb4af45e84f63f0ae967d7c7)

Transcribed text:

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

[Original PDF page 8](https://www.vintageapple.net/files/c2d541ab127ef32549202300089c0f172523dfb92af5224c2d1ef0eabd6c68f1/Learn_C_on_the_Macintosh_1989.pdf#page=8)

### PDF page 9

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-learn-c-on-the-macintosh-1989-506162/1#scan-1d4bf516b32a76cea15f6348cbfaddb0ec7f89e2218604c7a440bf6c690a3053)

Transcribed text:

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

[Original PDF page 9](https://www.vintageapple.net/files/c2d541ab127ef32549202300089c0f172523dfb92af5224c2d1ef0eabd6c68f1/Learn_C_on_the_Macintosh_1989.pdf#page=9)

### PDF page 10

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-learn-c-on-the-macintosh-1989-506162/1#scan-09d356e1e1b5f3bbad1c5d3f0a6ccae59dab886f3437e47d9510e5dc30109dc2)

Transcribed text:

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

[Original PDF page 10](https://www.vintageapple.net/files/c2d541ab127ef32549202300089c0f172523dfb92af5224c2d1ef0eabd6c68f1/Learn_C_on_the_Macintosh_1989.pdf#page=10)

### PDF page 11

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-learn-c-on-the-macintosh-1989-506162/1#scan-b5063e0440c0c1def3bdd9be8deba950bb99cef08b3c78006da46e5e88f2c0b4)

Transcribed text:

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

[Original PDF page 11](https://www.vintageapple.net/files/c2d541ab127ef32549202300089c0f172523dfb92af5224c2d1ef0eabd6c68f1/Learn_C_on_the_Macintosh_1989.pdf#page=11)

[Next transcribed scans](https://www.vintageapple.net/transcripts/media/va-learn-c-on-the-macintosh-1989-506162/2.md)
