← Macintosh C Primer Plus

Macintosh C Primer Plus

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

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

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
PDF page 1

- __ :::· +--~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
PDF page 2

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.

PDF page 3

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
PDF page 4

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
PDF page 5

MACINTOSH C PRIMER PLUS

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
PDF page 6

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.

PDF page 7

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
PDF page 8

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
PDF page 9

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
PDF page 10

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
PDF page 11

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