← Think C Proramming Fundamentals For The Macintosh 1993

Think C Proramming Fundamentals For The Macintosh 1993

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

PRIMA PRACTICAL PROGRAMMING SERIES THINK C!™ PROGRAMMING FUNDAMENTALS FOR THE MACINTOSH COVERS VERSION 6 Includes Macintosh Simulator C – an Innovative Tutorial Program on Two Disks! • Unleash the Full Power of Your Macintosh – Even if You Are Not a Programmer • Learn Macintosh Programming Fundamentals Quickly and Easily • Master the Basics of the THINK C Programming Language from the Ground Up VALUABLE MAC SIMULATOR C SOFTWARE INCLUDED PRIMA'S MACINTOSH SERIES DAN PARKS SYDOW

A book cover with a green and purple header band, large orange THINK C! title over a glowing close-up of computer keyboard keys showing numbers and letters, with small badge graphics for a software disk and Prima's Macintosh Series apple logo.

Reading notes: The word THINK on the left side of the title is partly overlapped by the large orange T, read as THINK in white tab text. Version 6 is printed as 'VERSION 6' in the orange corner banner, with 'COVERS' above it; the printed date is treated as a version number rather than a calendar date.

Printed product names
THINK C · Macintosh Simulator C
Printed dates
Version 6
Languages
English
PDF page 1

PRIMA PRACTICAL PROGRAMMING SERIES THINK C!™ PROGRAMMING FUNDAMENTALS FOR THE MACINTOSH Includes Macintosh Simulator C – an Innovative Tutorial Program on Two Disks! • Unleash the Full Power of Your Macintosh – Even if You Are Not a Programmer • Learn Macintosh Programming Fundamentals Quickly and Easily • Master the Basics of the THINK C Programming Language from the Ground Up COVERS VERSION 6 VALUABLE MAC SIMULATOR C SOFTWARE INCLUDED PRIMA'S MACINTOSH SERIES DAN PARKS SYDOW

A book cover with a teal and purple header reading PRIMA, a large orange THINK C! title over a dark green background, and a close-up of glowing keyboard keys labeled with numbers and letters, with two small inset badges at the bottom.

Reading notes: The word THINK appears in white on a purple band to the left of the large orange title and is treated as part of the title; the reading order of this stylized title is approximate. The 'Version 6' badge is read as 'COVERS VERSION 6'. Small badge text is legible but the reading order of the bottom badges relative to the author name is inferred from layout.

Printed product names
THINK C · Macintosh Simulator C
Languages
English
PDF page 2

The image is an entirely blank white page with no visible artwork, layout, or printed content.

Reading notes: No visible text or imagery was found in the scan, so the transcript and all printed fields are empty.

PDF page 3

Think THINK

A page with a large IBM-style THINK logo in black and gray, featuring a square with a gradient sphere motif and five diagonal gradient bars running from upper right to lower left, over a mostly blank white page with faint text blocks above and below the logo.

Reading notes: Faint text above the logo (apparently a heading and body paragraphs) and below the logo is too light to transcribe reliably and has been omitted. The word 'Think' appears in lowercase above the all-caps 'THINK' logo wordmark; both are treated as printed headline text. Headline choice is uncertain: 'Think' is the most prominent readable word.

Languages
English
PDF page 4

Prima Computer Books

Prima Computer Books Available Now WINDOWS Magazine Presents: Access from the Ground Up Advanced PageMaker 4.0 for Windows DESQview: Everything You Need to Know DOS 6: Everything You Need to Know WINDOWS Magazine Presents. Encyclopedia for Windows Excel 4 for Windows: Everything You Need to Know Excel 4 for Windows: The Visual Learning Guide WINDOWS Magazine Presents. Freelance Graphics for Windows: The Art of Presentation Harvard Graphics for Windows: The Art of Presentation LotusWorks 3: Everything You Need to Know Microsoft Works for Windows By Example NetWare 3.x: A Do-It-Yourself Guide Novell NetWare Lite: Simplified Network Solutions PageMaker 4.0 for Windows: Everything You Need to Know PageMaker 4.2 for the Mac: Everything You Need to Know PageMaker 5 for Windows: Everything You Need to Know WINDOWS Magazine Presents. The Power of Windows and DOS Together, 2nd Edition Quattro Pro 4: Everything You Need to Know QuickTime: Making Movies with Your Macintosh Smalltalk Programming for Windows (with 3¥2" disk) Superbase Revealed! SuperPaint 3: Everything You Need to Know Windows 3.1: The Visual Learning Guide Word for Windows 2: The Visual Learning Guide Word for Windows 2 Desktop Publishing By Example WordPerfect 5.1 for Windows Desktop Publishing By Example WordPerfect 6 for DOS: The Visual Learning Guide Upcoming Books CorelDRAW! 4 Revealed! Improv 2.1 Revealed! (with 3W' disk) How to Order: Individual orders and quantity discounts are available from the publisher, Prima Publishing, P.O. Box 1260BK, Rocklin, CA 95677-1260; telephone (916) 786-0426; fax (916) 786- 0488. If you are seeking a discount, include information on your letterhead concerning the intended use of the books and the number of books you wish to purchase.

Reading notes: Garbled characters in '3¥2"' and '3W'' disk' references Ambiguous '3W'' possibly a misprint for '3½"'

Printed product names
WINDOWS Magazine Presents: Access from the Ground Up · Advanced PageMaker 4.0 for Windows · DESQview: Everything You Need to Know · DOS 6: Everything You Need to Know · WINDOWS Magazine Presents. Encyclopedia for Windows · Excel 4 for Windows: Everything You Need to Know · Excel 4 for Windows: The Visual Learning Guide · WINDOWS Magazine Presents. Freelance Graphics for Windows: The Art of Presentation · Harvard Graphics for Windows: The Art of Presentation · LotusWorks 3: Everything You Need to Know · Microsoft Works for Windows By Example · NetWare 3.x: A Do-It-Yourself Guide · Novell NetWare Lite: Simplified Network Solutions · PageMaker 4.0 for Windows: Everything You Need to Know · PageMaker 4.2 for the Mac: Everything You Need to Know · PageMaker 5 for Windows: Everything You Need to Know · WINDOWS Magazine Presents. The Power of Windows and DOS Together, 2nd Edition · Quattro Pro 4: Everything You Need to Know · QuickTime: Making Movies with Your Macintosh · Smalltalk Programming for Windows (with 3¥2" disk) · Superbase Revealed! · SuperPaint 3: Everything You Need to Know · Windows 3.1: The Visual Learning Guide · Word for Windows 2: The Visual Learning Guide · Word for Windows 2 Desktop Publishing By Example · WordPerfect 5.1 for Windows Desktop Publishing By Example · WordPerfect 6 for DOS: The Visual Learning Guide · CorelDRAW! 4 Revealed! · Improv 2.1 Revealed! (with 3W' disk)
Languages
English
PDF page 5

T ink THINK Dan Parks Sydow I ) Prima Publishing P.O. Box I 260BK Rocklin, CA 95667-1260 (9 I 6) 786-04 26

Reading notes: Text appears fragmented with spacing artifacts (e.g., 'T ink', 'Dan Parks Sydow'), possibly from OCR. Possible damage in the address and phone number lines ('I ) Prima', 'I 260BK', '(9 I 6)').

Languages
English
PDF page 6

Prima Computer Books is an imprint of Prima Publishing, Rocklin, California 95677 © 1993 by Dan Parks Sydow. All rights reserved. No part of this book may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photo- copying, recording, or by any information storage or retrieval system without written per- mission from Prima Publishing, except for the inclusion of quotations in a review. Executive Editor: Roger Stewart Managing Editor: Neweleen A. Trebnik Project Editor: Stefan Griinwedel Production Coordinator: Linda Beatty Copyeditor: Betsy Ahl Technical Reviewer: David Holzgang Production: Susan Glinert, BookMakers Proofreader: Betsy Ahl Indexer: Dan Parks Sydow Book Designer: Susan Glinert, BookMakers Cover Designer: Page Design, Inc. THINK C is a trademark of Symantec Corporation. If you have problems with THINK C (not the enclosed Simulator C software tutorial), notify Symantec Corporation at (617) 275- 4800. Prima Publishing cannot provide software support for THINK C. See the warranty at the back of the book for information about the enclosed Simulator C software tutorial. Prima Publishing and the author have attempted throughout this book to distinguish pro- prietary trademarks from descriptive terms by following the capitalization style used by the manufacturer. Information contained in this book has been obtained by Prima Publishing from sources believed to be reliable. However, because of the possibility of human or mechanical error by our sources, Prima Publishing, or others, the Publisher does not guarantee the accuracy, ade- quacy, or completeness of any information and is not responsible for any errors or omissions or the results obtained from use of such information. Library of Congress Card Number: 93-085335 Printed in the United States of America 93 94 95 96 RRD 10 9 8 7 6 5 4 3 2 1

Reading notes: Spaced-out letters in some words (e.g., 'Prima', 'Griinwedel') may reflect OCR spacing artifacts Telephone number (617) 275-4800 and card number 93-085335 may be affected by line-break hyphenation

Printed product names
THINK C · Simulator C
Printed dates
1993 · 93-085335 · 93 94 95 96
Languages
English
PDF page 7

To my wife, Nadine

A dedication page with a dark gradient square at upper left, five diagonal gradient bars rising to the upper right, and the bold sans-serif headline above a horizontal gradient rule, with a faint ghosted table of contents behind the page.

Reading notes: Faint ghosted text behind the page (apparently a table of contents with page numbers and titles) is too washed out to transcribe reliably and was excluded. Background ghost text is not treated as part of the transcript.

Languages
English
PDF page 8

Contents at a Glance

Contents at a Glance Acknowledgments xv Introduction xvii Introduction to C 2 Introduction to Macintosh Programming 21 3 C Data Types 31 4 Introduction to Functions 49 5 C Operators 73 6 Decision Making: Looping 87 7 Decision Making: Branching 107 8 All About Functions 125 9 Memory and Pointers 139 10 Arrays and Structures 161 11 Introduction to QuickDraw 187 12 Deeper into QuickDraw 205 13 Resources and ResEdit 229 14 Events 241 15 Menus 273 16 Windows 299 17 Dialog Boxes and Alerts 321 18 Complete Resources-ShapeMaker 365 19 Complete Source Code-ShapeMaker 387 20 One for the Road-MacCertificate 413 Appendix- ASCII Character Codes 459 vi

Languages
English
PDF page 9

Table of Contents Acknowledgments lntrod"9ction Chapter I Introduction to C C: What and Why 2 What Is C? 2 Why Use C on the Macintosh? 2 The Science of Programming 3 Programming C in Six Phases 3 The Cycle of Programming 7 But I'm Only a Beginner! 7 A Comparison of ANSI C and Macintosh C 9 ANSI C 9 Macintosh C 9 Ready for Some C? I 0 Stepping through the Code I I Components of a C Program 17 Program Debugging 18 Syntax Errors 18 Semantic Errors 19 Chapter Summary 19 xv xvii vii

Reading notes: OCR-like damage in 'lntrod"9ction' and 'Introduction' spacing in the table of contents Chapter page numbers appear as 'I I' and 'I 0' with uncertain reading

Languages
English
PDF page 10

THINK C Programming

viii Think THINK C Programming Chapter 2 Introduction to Macintosh Programming Why the Mac Is Unique 22 The Macintosh Toolbox 22 Resources 23 The Structure of a Macintosh Program 24 This Book's Approach to Programming 2S One Step at a Time 26 The Role of the Simulator Software 27 Using Pseudo Code 27 Programming with THINK C 29 Chapter Summary 29 Chapter 3 C Data Types ANSI C Data 32 Data Types in Action 33 What's New 33 Variables and Constants 3S Why Different Data Types? 36 C Data Types 37 The int Type 37 The long Type 39 The char Type 39 The float Type 41 Type Conversion 42 Symbolic Constants: #define 44 Chapter Summary 46 Chapter 4 Introduction to Functions Flashback: What a Function Is SO Calling All Functions SO Toolbox Functions S4 More Than just DrawStringQ 55 Function Naming 56 Advantages of Functions S7 Reusability 58 Clarity 59 An Aid in Planning 61 Debugging 61 Program Maintainability 61 The Scope of a Variable 62 Local Variables 62 Global Variables 64 Variable Naming 65 Value Retention 65 Local versus Global 66 Cheating at Windows 68 One More Function of Our Own 69 Chapter Summary 71 21 31 49

Reading notes: Some characters in the table of contents appear as 'S' in place of digits (e.g., 'S0', 'S4', '2S'), likely OCR errors.

Printed product names
THINK C
Languages
English
PDF page 11

Chapter 5 C Operators

Chapter 5 C Operators Operators in Action 73 The Basic Operators 75 The Assignment Operator 75 The Math Operators 76 The Sign Operators 78 One Up, One Down 78 The Increment and Decrement Operators 79 But Are They Necessary? 80 Mathematical Precedence 80 Expressions 82 Statements 83 Chapter Summary 84 Chapter 6 Decision Making: Looping A Sample Loop 87 Initialization 88 A Function Call 89 The while Loop 89 The Loop Block 89 Outside the Loop Block 90 TRUE and FALSE 90 Comparative Operators 91 The Comparative Operators 93 The Equality and Inequality Operators 94 Comparative Operators-Not Just for Integers 96 Assignment Operators 97 The while Loop 97 The while Expression 98 The while Body 98 Pre-execution Check 98 The for Loop I 00 Pre-execution Check I 02 The do-while Loop I 03 Post-execution Check I 03 When "do" You Use "while,'' and What "for"? I 04 Chapter Summary I 06 Chapter 7 Decision Making: Branching The if Statement I 07 About Branching Statements I 08 The if Statement-Formalized I 09 The if-else Statement: Adding Power 11 0 The else-if Statement: Still More Power 112 The switch Statement I 16 Logical Operators 119 switch or if? 121 Chapter Summary 123 Table of Contents ix 73 87 107

Reading notes: Table of contents page numbers in the source are partly garbled (e.g., "I 00", "I 02", "I 04"), likely OCR artifacts for 100, 102, 104.

Languages
English