# Programming the Macintosh in C 1986 — source transcripts, page 1

[Canonical transcript page](https://www.vintageapple.net/transcripts/media/va-programming-the-macintosh-in-c-1986-78e0c8/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-programming-the-macintosh-in-c-1986-78e0c8/1#scan-fa64d8129d0e0ed423542952012b0559feddb0e2d4cf4bb8ba38b651123f0dd1)

Transcribed text:

Programming the Macintosh™ in C

Bryan J. Cummings
Lawrence J. Pollack

SYBEX

Image description: A book cover with large orange title lettering on a dark blue background, a streaking comet-like shape with a large stylized letter C at lower right, and a SYBEX logo at lower left over a cloudy sky.

Reading notes: The trademark symbol after Macintosh is small and rendered as ™; transcribed as printed. Author names are set in smaller orange type over the illustration and are legible.

Languages: English

[Original Image 1](https://www.vintageapple.net/files/97aa618356b0af8843d83e6569ea546d5bbbcaf4b1b8bccadb4f7eff6e35742d/608f578487a3f4d68de01de3.webp)

### PDF page 1

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-programming-the-macintosh-in-c-1986-78e0c8/1#scan-fa5b0088466a6f3e7fc484b44b307937d92e1ac0b7cf12296cc0a0e80aeac8da)

Transcribed text:

Programming the
Macintosh™
in C

Bryan J. Cummings
Lawrence J. Pollack

SYBEX

Image description: A book cover with bold orange title text on a dark blue night-sky background, with a large metallic letter C rendered with streaking light trails and a SYBEX logo in the lower left corner over clouds.

Reading notes: Trademark symbol after Macintosh is small and may be read as ™ at the top right of the title.

Languages: English

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

### PDF page 2

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-programming-the-macintosh-in-c-1986-78e0c8/1#scan-abd230998c57ac7dd71fcbdf06297fbc44e9a32aa0a4d208a82c91a2cb15b172)

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

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

### PDF page 3

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-programming-the-macintosh-in-c-1986-78e0c8/1#scan-b2d02033a1367d716cf18d24a9b5a4984156d5e34df72be0733028535cc70e1a)

Transcribed text:

PROGRAMMING
THE   MACINTOSHTM
IN   c
BRYAN   ...J.   CUMMINGS
LAWRENCE   ...J.   POLLACK
Berkeley   •   Paris   •   Dusseldort   •   London

Reading notes: Author names are partly spaced or separated by ellipsis-like characters (BRYAN J. CUMMINGS, LAWRENCE J. POLLACK); spelling preserved as printed.

Languages: English

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

### PDF page 4

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-programming-the-macintosh-in-c-1986-78e0c8/1#scan-6c637cbd2d59a052e443e00a15ecf90cf955820974165004384732b7c992c730)

Transcribed text:

Cover art by Jean-Francois Penichoux
Book design by Lisa Amon
We have taken great care in preparing this book. All information is deemed to be accurate at
time of publication. All programming examples have been thoroughly tested on a Macintosh
with two disk drives, the Consulair Mac C compiler (release   2.0),   and the Macintosh   Devel-
opment System.
Aztec C68K compiler is copyrighted by Manx   Software   Systems.
The Consulair Mac C compiler is copyrighted by Consulair Corporation.
C/PM-80   and   C/PM-86   are trademarks of Digital Research, Inc.
Macintosh is a trademark of Apple Computer Incorporated.
The Macintosh Development System is copyrighted by Apple Computer Incorporated.
MS.DOS   is a trademark of Microsoft Corporation.
PC-DOS   is   a trademark of IBM Corporation.
UNIX   is a trademark of Bell Laboratories.
SYBEX is not affiliated with any manufacturer.
Every effort has been made to supply complete and accurate information. However,   SYBEX
assumes no responsibility for its use, nor for any infringements of patents or other rights of
third parties which would result.
Copyright©1986   SYBEX   Inc., 2344 Sixth Street, Berkeley, CA   94710.   World rights reserved.
No   part   of this publication may   be   stored in a retrieval system, transmitted, or reproduced
in any way, including but not limited to photocopy, photograph, magnetic or other record,
without the prior agreement and written permission of the publisher.
Library of Congress Card Number:   85-63244
ISBN   0-89588-328-7
Printed by Haddon Craftsmen
Manufactured in the   United   States of America
10   9 8 7 6 5 4 3 2 1

Reading notes: Release number '2.0' for the Consulair Mac C compiler is listed without a clear date context

Printed product names: Aztec C68K compiler · Consulair Mac C compiler · Macintosh Development System · C/PM-80 · C/PM-86 · Macintosh · MS.DOS · PC-DOS · UNIX

Printed dates: 1986 · 2.0

Languages: English

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

### PDF page 5

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-programming-the-macintosh-in-c-1986-78e0c8/1#scan-539c8d742c4cd7de5d72fa9e47a617c0d2b02571b6cab486614669e731c5ab8b)

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

Reading notes: No visible text found on the page; transcript and printed fields left empty.

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

### PDF page 6

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-programming-the-macintosh-in-c-1986-78e0c8/1#scan-929c8f53116df3db8e68b25a8122a06f823e03147d02cdc0a82c980ff1b31848)

Transcribed text:

~CKNOWLEDGEMENTS
The production of a book requires many steps and many people.
For ourselves, and on behalf of DATATECH Publications, the authors
would like to thank those people who have helped to create this book.
First of all, we want to thank Geta Carlson for her magnificent   edito-
rial support. At SYBEX, we would like to thank Dr. R.   S.   Langer and
Karl Ray for managing this project so well. Also at SYBEX, thanks to
Lisa Amon for her book design, Joel Kroman for technical support,
Brenda Walker for typesetting, Dave Clark and Scott Campbell for
word processing, Jon Strickland for proofreading, and Jannie Dresser
for the tedious task of indexing.
B.   C.
L.   P.

Reading notes: Leading word '~CKNOWLEDGEMENTS' appears to be a damaged or OCR-garbled heading; first letter uncertain.

Languages: English

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

### PDF page 7

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-programming-the-macintosh-in-c-1986-78e0c8/1#scan-ca0648a9034665b5381873cd9ce033e1811f25be6bd127280440fd52823eaeeb)

TABLE OF CONTENTS

Transcribed text:

TABLE   OF   CONTENTS
INTRODUCTION
How   This   Book Is Organized   xv
What You Need to   Use   This Book   xvii
A   REVIEW   OF   SOME   PROGRAMMING   BASICS
A   BRIEF   LOOK   INSIDE   THE   COMPUTER   1
The Central Processing   Unit   1
Memory 2
NUMBERING   SYSTEMS   3
The Binary Numbering   System   3
Converting from Binary to Decimal   4
Converting from Decimal to Binary   5
Binary Arithmetic   6
Other Numbering Systems: Octal and Hexidecimal 6
How   DATA   IS   STORED   7
How Numbers   Are   Represented   9
Character Representation   12
AN   OVERVIEW   OF   MEMORY   ORGANIZATION   13
Files   15
The Operating   System   16
WRITING   A   PROGRAM   18
The Programming Process   18
Dealing with Errors   19
PROGRAMMING   LANGUAGES
WHAT   PROGRAMMING   LANGUAGES   DO   23
The Differences Between Programming Languages   26
The Jobs a Language Is Designed For   26
vii
ONE
TWO

Reading notes: Chapter heading lines 'ONE' and 'TWO' appear without titles Spelling 'Hexidecimal' appears as printed

Languages: English

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

### PDF page 8

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-programming-the-macintosh-in-c-1986-78e0c8/1#scan-a1216a60d33d4d529e1ab1fce210d0e64b604eb9f096128a918c0870df4a60ba)

Transcribed text:

viii
The Levels of a Language   26
A Language's   Special   Tools   27
Interpreted vs Compiled Languages   27
THE   SPECIAL   CHARACTERISTICS   OF   C   28
Data   Storage   and Definition   28
Portability   29
Tools for Building Commands   30
Writeability: Structured Programming   30
Readability: Internal   Program   Documentation   31
DEVELOPING   PROGRAMS:   SYNTAX,   LOGIC,
AND THE   ROLE   OF   STATEMENTS   32
The Programmer's Axioms   32
The   Syntax   of   C   33
Basic Programming Logic 36
Developing a   Program   Statement 36
INTRODUCTION   TO   USING   C
USING   COMMENTS   TO   OUTLINE   YOUR   PROGRAM   39
CREATING,   COMPILING,   AND   EXECUTING   SOURCE   CODE   40
BASIC   OPERATORS   44
Arithmetic Operators   44
Combined Forms of Arithmetic and Assignment
Operators   46
INTRODUCTION   TO   DATA   TYPES   48
A   Sample   Program   49
RELATIONAL   AND   LOGICAL   OPERATORS   52
Definition and Background of Logic Statements   52
Forming Logical Expressions   54
CONTROLLING   PROGRAM   FLOW   55
Control Statements   55
Statement Blocks   55
THREE

Reading notes: Source appears to be a table of contents fragment with no advertised products, prices, or dates; headline is not a primary heading.

Languages: English

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

### PDF page 9

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-programming-the-macintosh-in-c-1986-78e0c8/1#scan-e1c6c63657f77e9045cf4a1b9286e5ad9ca2f7d1cd72d443611d6738c19585bd)

CONDITIONAL EXECUTION STATEMENTS

Transcribed text:

CONDITIONAL   EXECUTION   STATEMENTS   56
The   IF   Statement   56
The   IF-ELSE   Statement   58
The   ELSE-IF   Statement   60
The?: Operator   62
REPETITION   STATEMENTS   63
The   WHILE   Statement   63
The   FOR   Statement   65
The   DO-WHILE   Statement   67
The   CONTINUE   Statement   68
The BREAK Statement   69
The   SWITCH-CASE-DEFAULT   Statement   70
THE   GOTO   STATEMENT   72
PROGRAMMING   TECHNIQUE
STRUCTURED   PROGRAMMING   75
FUNCTIONS   78
Scoping   80
Local Variables   80
Global Variables   82
Storage Classes   84
PARAMETERS   86
A   SAMPLE   PROGRAM   88
RETURNED   VALUES   90
USING   FUNCTIONS   91
Library Functions   92
Our   GETNUM()   Function   96
RECURSION   97
ix
FOUR

Reading notes: Source appears to be a table of contents; heading placement and spacing are inconsistent across lines Spacing between words in some entries is irregular

Languages: English

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

### PDF page 10

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-programming-the-macintosh-in-c-1986-78e0c8/1#scan-c2fe45b07514d08218ca975b987d63610cd71c300047ce747dcbf25b5c1fcf60)

Transcribed text:

x
DATA   TYPES
THE DATA   TYPES   103
CONSTANT   VALUES   105
DATA TYPE   DETERMINATION   106
DATA TYPE   CONVERSION   107
DATA   STRUCTURES
STRUCTURING   YOUR   DATA   113
WORKING   WITH   POINTERS   AND   ADDRESSES   115
The   Addresses Operator:   &   116
Pointers   116
The Pointer Operator:   *   116
A Warning About Pointers   120
Functions and Pointers   121
WORKING   WITH   ARRAYS   123
What Is an Array?   123
Using   Arrays   124
Arrays and Pointers   128
Array and Pointer Arithmetic   130
Array Initialization   131
Strings   132
Multidimensional Arrays   133
Arrays of Pointers   134
Pointers to Functions   135
DATA   STRUCTURES   137
Creating Data Structures:   STRUCT   138
Pointers to Structures   140
Structures and Functions   141
DATA   STRUCTURING   TECHNIQUES:   A   SAMPLE   PROGRAM   143
Fields and   Unions   154
Th.{'   TYPEDEF Facility   157
FIVE
SIX

Reading notes: Table of contents text contains irregular spacing and a garbled fragment 'Th.{' near the end Reading order of the list is ambiguous due to extraction

Languages: English

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

### PDF page 11

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-programming-the-macintosh-in-c-1986-78e0c8/1#scan-9c9d6fc7229e2101a23c6529a921cc98406e3d6e8516e4296c3fa6a845340ed8)

THE STANDARD LIBRARY

Transcribed text:

BIT   MANIPULATION   OPERATORS   159
SUMMING   UP   161
THE STANDARD   LIBRARY
C   AND   UNIX   166
The Standard Input and Output   166
Portability   167
USING   THE STANDARD   1/0   LIBRARY   168
Console Routines   168
Character and String Functions   179
Mathematical Functions   181
Memory Allocation and System Interface Functions   181
ACCESSING   FILES   FROM   WITHIN   YOUR   PROGRAM   182
Using   Disk Files for Input and Output   183
Types of file Access   183
File Functions   184
Stream vs File   1/0   186
Using   Standard   1/0   Files   189
Command Line Arguments   192
SEVEN
THE   MACINTOSH   ENVIRONMENT   VS   THE   UNIX   ENVIRONMENT   196
A Note About   Using   Toolbox Routines   197
COMPILING   YOUR   PROGRAM
COMPILING   YOUR   PROGRAM   201
USING   COMPUTER   DIRECTIVES   203
The   #DEFINE   Directive   203
The   #INCLUDE   Directive   206
Conditional   Compilation   Directives   207
Miscellaneous   Directives   209
DEALING   WITH   COMPILER   ERRORS   211
EIGHT
xi

Reading notes: Table of contents layout makes reading order of page numbers and section titles somewhat ambiguous Heading 'COMPILING YOUR PROGRAM' appears twice in succession, possibly a duplicated line

Languages: English

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

[Next transcribed scans](https://www.vintageapple.net/transcripts/media/va-programming-the-macintosh-in-c-1986-78e0c8/2.md)
