# Macintosh C Primer Plus — source transcripts, page 1

[Canonical transcript page](https://www.vintageapple.net/transcripts/media/va-macintosh-c-primer-plus-1986-5ef98e/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-macintosh-c-primer-plus-1986-5ef98e/1#scan-5a16acc514ec952dff1739acebf3da74f9e57418c2ebf3ef4672ada4905f7e0d)

Transcribed text:

MACINTOSH
C
PRIMER PLUS
THE WAITE GROUP/STEPHEN W. PRATA
BANTAM COMPUTER BOOKS

Image description: A book cover with a grid-paper background scattered with decorative multicolored letter C's, featuring a central framed panel with a large black C on a lavender field, between gray bands reading MACINTOSH and PRIMER PLUS, with the author line below and the Bantam Computer Books logo at lower left.

Reading notes: The large central letter C is a graphic element and may or may not be intended as text; transcribed as C. Bantam logo text is small and reads BANTAM COMPUTER BOOKS.

Languages: English

[Original Image 1](https://www.vintageapple.net/files/f302b2de87d8d547c2903f25e938d08433f836410d237729f8e258ffe1a6ee84/0f130b02725daa9ae7ef24a9.webp)

### PDF page 1

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-c-primer-plus-1986-5ef98e/1#scan-9775eac863f46f98a7290ab31473f4e64a43795e7e9550923338878ba27d87ec)

Transcribed text:

- __   :::·
+--~l---4~----1-1   ~;   . -~   lt----1f--.-+~-+~-+-~-t-~+-----i~--+~-+~-+-~-t-~+-~t----+~--+
BA   ITTAM
COMP UTER
B   0   0   K   S

Reading notes: Headline is inferred from the three text lines and may be split, misspelled, or wrongly joined ("BA ITTAM" could be a damaged word, and "COMP UTER" has an unexplained gap). The garbled band of symbols above the text is unreadable and was not transcribed. No image was provided, so layout, colors, and reading order could not be verified visually. Language is assumed to be English from the words "COMPUTER" and "BOOKS".

Languages: English

[Original PDF page 1](https://www.vintageapple.net/files/974af3e1739c5fbdf0e97a80cfd219dd8fe49ef7bd03542349b9c2aa522c3aae/Macintosh_C_Primer_Plus_1986.pdf#page=1)

### PDF page 2

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-c-primer-plus-1986-5ef98e/1#scan-26b2b9dead1c70a5e99ab9c9fb8f70f52a9b62ec7b96d8e955ba559a39851bcd)

Image description: The image is a entirely blank white page with no visible artwork, layout, or text.

Reading notes: No visible text or imagery was found on the scan, so the transcript is empty.

[Original PDF page 2](https://www.vintageapple.net/files/974af3e1739c5fbdf0e97a80cfd219dd8fe49ef7bd03542349b9c2aa522c3aae/Macintosh_C_Primer_Plus_1986.pdf#page=2)

### PDF page 3

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-c-primer-plus-1986-5ef98e/1#scan-5d22bafc45a2b126878712889475ff09dcbaac0062e1f33b24153e5d6ce23170)

Transcribed text:

Bantam Computer Books
Ask your bookseller for the books you have missed
TIIE AMIGADOS MANUAL
by Commodore-Amiga, Inc.
TIIE   APPLE   //cBOOK
by Bill O'Brien
TIIE   COMMODORE   64 SURVIVAL MANUAL
by Winn L. Rosch
COMMODORE   128   PROGRAMMER'S   REFERENCE GUIDE
by Commodore Business Machines, Inc.
EXECUTIVE GUIDE TO TIIE   EPSON   GENEVA
by Marshall   P.   Smith
EXPLORING ARTIFICAL INTELLlGENCE   ON   YOUR   APPLE II
by Tim Hartnell
EXPLORING ARTIFICAL INTELLlGENCE   ON   YOUR   COMMODORE   64
by Tim Hartnell
EXPLORING ARTIFICAL INTELLlGENCE   ON   YOUR   IBM   PC
by Tim Hartnell
EXPLORING TIIE UNIX ENVIRONMENT
by The Waite Group/Irene   Pasternack
FRAMEWORK   FROMTIIE   GROUND   UP
by The Waite Group/Cynthia   Spoor   and Robert Warren
HOW   TO   GET TIIE   MOST   OUT   OF   COMPUSERVE,   2d   EDmON
by Charles Bowen and David Peyton
HOW   TO   GET   TIIE   MOST   our   OFTIIE   SOURCE
by Charles Bowen and David   Peyton
TIIE   MACINTOSH
by Bill   O'Brien
TIIE NEW   jr:   A GUIDE   TO   IBM'S   PCjr
by Winn L. Rosch
ORCHESTRATING   SYMPHONY
by The Waite Group/Dan   Shafer   with   Mary   Johnson
PC-DOS/MS-DOS
User's   Guide   to   the   Most   Popular   Operating   System/or   Personal   Computers
by Alan   M.   Boyd
POWERPAINTING:COMPUI'ERGRAPHICSONTIIEMACINTOSH
by   Verne   Bauman and Ronald Kidd/illustrated by Gasper   Vaccaro
SMARTER   TELECOMMUNICATIONS
Hands on   Guide   to   On-Line   Computer   Services
by Charles Bowen and   Stewart   Schneider
SWING   wrnIJA1Z
Lotus   Jazz on   the   Macintosh
by   Datalech   Publications/Michael McCarty
TEACH   YOUR   BABY   TO   USE   A   COMPUTER
Birth   Through   Preschool
by Victoria Williams, Ph.D. and Fredrick Williams, Ph.D.
UNDERSTANDING EXPERT   SYSTEMS
by The Waite Group/Mike   Van   Hom
USER'S   GUIDE TO TIIE AT&T PC   6300   PERSONAL   COMPUTER
by David B. Peatroy, Ricardo A. Anzaldua, H. A. Wohlwend, and   Datatcch   Publications

Reading notes: Headline and some title lines contain OCR-like character errors (e.g., 'TIIE' for 'THE', 'ARTIFICAL', 'INTELLlGENCE'), so spellings may not match the original print. Product names are reproduced as printed in the supplied copy; 'SWING wrnIJA1Z' and 'SMARTER' title lines are uncertain.

Printed product names: AmigaDOS Manual · Commodore 64 Survival Manual · Commodore 128 Programmer's Reference Guide · The Macintosh · Orchestrating Symphony · Smarter Telecommunications: Hands on Guide to On-Line Computer Services · Teach Your Baby to Use a Computer: Birth Through Preschool · Understanding Expert Systems

Languages: English

[Original PDF page 3](https://www.vintageapple.net/files/974af3e1739c5fbdf0e97a80cfd219dd8fe49ef7bd03542349b9c2aa522c3aae/Macintosh_C_Primer_Plus_1986.pdf#page=3)

### PDF page 4

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-c-primer-plus-1986-5ef98e/1#scan-632069a29529afdd02ec3d99e475576b4ccb0de1e4c4ca399df99446f9b6093c)

Transcribed text:

Stephen Prata
The Waite Group
Macintosh   TM
C Primer Plus
•l
~~ •ii
BANTAM   BOOKS
TORONTO•   NEW   YORK•   LONDON•   SYDNEY•   AUCKLAND

Reading notes: Stray characters '•l' and '~~ •ii' appear in the source text and are unclear.

Printed product names: Macintosh · C Primer Plus

Languages: English

[Original PDF page 4](https://www.vintageapple.net/files/974af3e1739c5fbdf0e97a80cfd219dd8fe49ef7bd03542349b9c2aa522c3aae/Macintosh_C_Primer_Plus_1986.pdf#page=4)

### PDF page 5

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-c-primer-plus-1986-5ef98e/1#scan-6f16fa4d77e6b60a2295eea2efbdcbd88be4d4cff4cf01bd5fc5305eaec4cebb)

MACINTOSH C PRIMER PLUS

Transcribed text:

MACINTOSH   C   PRIMER   PLUS
A Bantam Book/March 1986
Apple, LaserWriter, MacDraw, and   MacPaint   are registered trademarks of Apple Computer Inc.
Macintosh is a trademark licensed to Apple Computer Inc.
Hippo C is a trademark of Hippopotamus Software, Inc.
Microsoft Word is a registered trademark of Microsoft Corporation
UNIX   is a trademark of AT&T Bell Laboratories
Throughout   the   book,   the   trade names   and   trademarks of some companies and products have been
used and no such uses are intended to convey endorsements of or other affiliations with the book.
Moreover, the reader shoud not assume Apple or Hippopotamus Software have in any way
authorized or endorsed this book, which is   the   result of the authors' own research and analysis.
All rights reserved.
Copyright   ©   1986 by The Waite Group, Inc.
This book may not be reproduced in whole or   in   part, by mimeograph or any other means,
without permission.
For information address:   Bantam Books, Inc.
ISBN   0-553-34197-9
Published simultaneously in the   United   States   and   Canada
Bantam Books are published by Bantam Books, Inc.   Its trademark, consisting of the words
"Bantam   Books"   and the portrayal of a rooster, is registered in the   U.S.   Patent and Trademark
Office   and in other countries.   Marca Registrada.   Bantam Books, 666 Fifth Avenue, New York,
NY   10103.
PRINTED IN THE   UNITED   STATES   OF   AMERICA
BH   0   9 8 7 6   5   4 3 2 1

Reading notes: Typo 'shoud' appears in the source copy as printed

Printed product names: Apple · LaserWriter · MacDraw · MacPaint · Macintosh · Hippo C · Microsoft Word · UNIX

Printed dates: March 1986 · 1986

Languages: English

[Original PDF page 5](https://www.vintageapple.net/files/974af3e1739c5fbdf0e97a80cfd219dd8fe49ef7bd03542349b9c2aa522c3aae/Macintosh_C_Primer_Plus_1986.pdf#page=5)

### PDF page 6

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-c-primer-plus-1986-5ef98e/1#scan-bf5a7bc0f600231e17b4d6aab4d79e3cd7b030112bf35245c0415475dc967d60)

Image description: The image is a plain, entirely blank white page with no visible artwork, layout, or text.

Reading notes: No visible text was found in the image, so the transcript and printed fields are empty.

[Original PDF page 6](https://www.vintageapple.net/files/974af3e1739c5fbdf0e97a80cfd219dd8fe49ef7bd03542349b9c2aa522c3aae/Macintosh_C_Primer_Plus_1986.pdf#page=6)

### PDF page 7

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-c-primer-plus-1986-5ef98e/1#scan-01c7bca82c8be28967bdd02ca2d3272ea89ae17aa5f4399749366de2634423d3)

Transcribed text:

Contents
Acknowledgments
Preface
1   C as a Macintosh Programming Language
CandYou   2
This Book Is For...   3
Macintosh C   Versus   Generic C   3
How Computer Languages Work   6
Which C Compiler?   9
Starting Off in Hippo C   10
What's Ahead   14
1
2   C Basics   17
C and Functions: The Modular Approach   17
Variables and Declarations   23
Operators   27
Expressions and Statements   33
More on Functions: Arguments and Return   Values   35
Summary   42
3   I/O   Functions and Types
Character I/O   44
The Character Type   52
The C Preprocessor - A First Look   59
Other C Types   62
Formatted Output: printf'()   67
Formatted Input: scanf()   74
Toolbox Examples   79
Summary   84
4   Control Statements
The while Loop   86
The do...   while Loop   88
The for Statement   89
Other C Assignment Operators   92
Nested Loops   93
Two   if   Statements   96
Conditional Expressions   99
Other Jumps   109
43
85
vii

Reading notes: Table of contents layout and chapter page numbers have uncertain reading order in extracted text.

Languages: English

[Original PDF page 7](https://www.vintageapple.net/files/974af3e1739c5fbdf0e97a80cfd219dd8fe49ef7bd03542349b9c2aa522c3aae/Macintosh_C_Primer_Plus_1986.pdf#page=7)

### PDF page 8

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-c-primer-plus-1986-5ef98e/1#scan-669b58faca585729c92ffe9cead12887787f6a09b4203decee12095dec69703b)

Transcribed text:

More Operators   116
Summary   118
5   Functions
Review   119
Arguments   120
Return   Values   125
Return   Values   and Functions Types   126
Type Conversions and Type Casts   131
Using Addresses and Pointers   134
Scope:   Local and Global Variables   144
Recursion   151
Macros   155
Summary   160
6   Arrays and Structures
The Array   164
Structures   178
A Quickdraw Structure   181
Functions, Structures, and Pointers   188
Friendly Advice   191
Summary   192
7   Compound Data Structures
Arrays of   Structures   195
Complex Declarations and typedef   210
Function Pointers   215
·   Summary   217
119
163
195
8   Character   Strings   221
Character   Strings   221
String   1/0   225
String   Functions   235
Writing C   String   Functions   240
Macintosh Pascal   Strings   249
Quickdraw Functions   251
Programming With Pascal-Formatted   Strings   256
Summary   257
9   C and the Macintosh Toolbox
viii
Pascal Procedures and Functions   259
Pascal Types   264
Back to Quickdraw   271
Patterns   281
The Cursor   288
259

Reading notes: Source is a table of contents listing chapters and sections; no advertised products, prices, or dates are present. Some line breaks and spacing in the listing may be extraction artifacts.

Languages: English

[Original PDF page 8](https://www.vintageapple.net/files/974af3e1739c5fbdf0e97a80cfd219dd8fe49ef7bd03542349b9c2aa522c3aae/Macintosh_C_Primer_Plus_1986.pdf#page=8)

### PDF page 9

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-c-primer-plus-1986-5ef98e/1#scan-f4d5e54f87989af08b4880e225bf898efb9ce27b0153b747b0df6742a06756ec)

Transcribed text:

One More Example   291
Summary   295
10   A Mac Miscellany
The Macintosh Software System   297
Macintosh Memory Management   298
Regions   309
Events   319
Files   329
A Soundrnouse Experiment   338
Summary   341
Conclusion   342
A   Keywords in   C
B   Operators
C   Binary, Octal, and Hexadecimal Numbers
D   Bit Fiddling
E   Macintosh   ASCII   Table
Index
297
345
347
355
361
369
377
ix

Reading notes: Source is a table of contents fragment with page numbers and no product, price, or date content Heading-like text lacks a clear primary headline

Languages: English

[Original PDF page 9](https://www.vintageapple.net/files/974af3e1739c5fbdf0e97a80cfd219dd8fe49ef7bd03542349b9c2aa522c3aae/Macintosh_C_Primer_Plus_1986.pdf#page=9)

### PDF page 10

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-c-primer-plus-1986-5ef98e/1#scan-72dbae125570854498103c3cdbe118d592525c2b605ba099e3617b54d0d48363)

Transcribed text:

Acknowledgments
I would like to thank Jerry Volpe of the Waite Group for his editorial
guidance, Mitchell Waite of the Waite Group for his support, and Rick
Oliver of Hippo Software for answering questions.
xi

Languages: English

[Original PDF page 10](https://www.vintageapple.net/files/974af3e1739c5fbdf0e97a80cfd219dd8fe49ef7bd03542349b9c2aa522c3aae/Macintosh_C_Primer_Plus_1986.pdf#page=10)

### PDF page 11

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-c-primer-plus-1986-5ef98e/1#scan-e7d44b2f261e9f44e886d972c29c080ba77a6b670900201d9fb84285c52d777f)

Transcribed text:

Preface
C is undoubtedly the most popular language for   seri9us   software
development on microcomputers today. C's syntax is direct, compact, and
easy to learn, and is well suited to an efficient, modular style of program
development. Because of its syntax, and because it is a compiled language,
C translates into programs that run quickly and use a minimum of memory.
C's modularity also makes it easy to adapt a particular program to run on
many different computers.   On the Macintosh, C provides a direct and
efficient way to access the Mac's built-in Toolbox and Quickdraw routines,
which are essential for writing   "Mac-like"   programs that make use of the
Mac's outstanding graphics and features such as windows, menus, and the
mouse.
This book is written for two groups of readers.   If   you have never
programmed in C before, this book provides a complete introduction to the
language, using simple examples and a step-by-step approach. You'll find it
helpful to have at least a nodding familiarity with some other computer
language such as BASIC or   Pascal   -   it is possible to learn C as a first
language, but Chas so many advanced features it's helpful if you've gotten
your feet wet with a less complete language.   If   you are already experienced
in C, this book will teach you how to use the language effectively in the
Macintosh environment. The Mac is so different from other computers that
using C to access the Mac's advanced features forms a major part of the
book; C programmers will find it a whole new world.
The program examples in this book are based on the Hippo C Level 1
compiler, which is a product of Hippopotamus Software, Inc. of Los
Gatos, CA.   As we discuss more fully in Chapter 1, we chose Hippo C
because we found it to be an excellent first choice for anyone learning to
program in C. It is easy to use, provides a full implementation of C, has a
superior method of dealing with error messages, provides direct access to
the Toolbox routines, and uses an easy MacWrite-style editor.   However,
we should emphasize that this book will work with any of the popular
C compilers on the Mac. Where there are differences between Hippo and
standard C, such as the use of floating point, we point them out, and
explain how the standard version works.
xiii

Reading notes: Garbled character in 'seri9us' within the Preface body text Word 'Chas' appears to be a typographical error, possibly for 'C has'

Printed product names: Hippo C Level 1 · Macintosh · Mac · Hippo C

Languages: English

[Original PDF page 11](https://www.vintageapple.net/files/974af3e1739c5fbdf0e97a80cfd219dd8fe49ef7bd03542349b9c2aa522c3aae/Macintosh_C_Primer_Plus_1986.pdf#page=11)

[Next transcribed scans](https://www.vintageapple.net/transcripts/media/va-macintosh-c-primer-plus-1986-5ef98e/2.md)
