# Teach Yourself Mac C++ Programming in 21 Days — source transcripts, page 1

[Canonical transcript page](https://www.vintageapple.net/transcripts/media/va-teach-yourself-mac-c-programming-1994-b286c4/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-teach-yourself-mac-c-programming-1994-b286c4/1#scan-6ef2bdadf0c6cc108585fb4d0b204dc7fee776425faf524bf1c958803cd47cf8)

TEACH YOURSELF MAC C++ PROGRAMMING IN 21 DAYS

Transcribed text:

SAMS PUBLISHING

TEACH YOURSELF
MAC C++ PROGRAMMING
IN 21 DAYS

Covers Symantec C++ version 7.0 and THINK Class Library (TCL) version 2.0!

Find out how to program in C++ using the Symantec C++ compiler

Learn how to develop GUI applications using the latest version of the THINK Class Library (TCL)

Explore the Visual Architect utility, a tool that makes it easier to create Mac programs

No Previous Programming Knowledge Required!

Amir Shammas

FRIDAY Good Friday 1 91/274
THURSDAY
8 98/267
15 105/260
7 14 21
27 117/248
26 116/249

Image description: A book cover shows a beige Macintosh-style keyboard and a desk calendar with pink highlighted day cells numbered 7, 14, and 21 against a dark green gradient background with a yellow starburst badge.

Reading notes: Left edge of the cover text is cut off, so words such as 'Teach', 'Find', 'Learn', 'Develop', 'Applications', 'Version', 'HINK', and 'Library' are partially visible and reconstructed from context; the author's first name is partly obscured by the cover fold. Calendar date labels are small and the numbers beside weekday names are uncertain; '116/249' and '176/249' readings for the bottom-left date are unclear. Reading order of calendar fragments is approximate.

Printed product names: Symantec C++ · THINK Class Library (TCL) · Visual Architect

Printed dates: FRIDAY · THURSDAY · Good Friday · 91/274 · 98/267 · 105/260 · 117/248 · 116/249

Languages: English

[Original Image 1](https://www.vintageapple.net/files/9b658e9643d35342471c69df3a47cc736d8ec891cd0890b6bf1059e01d5e5a34/b0c2dd019173af7ecca2b3f1.webp)

### PDF page 1

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-teach-yourself-mac-c-programming-1994-b286c4/1#scan-163515d8b6f22f25f7e51cd37347bf753b24725fc8f31681719dbd630def0f09)

TEACH YOURSELF MAC C++ PROGRAMMING IN 21 DAYS

Transcribed text:

SAMS PUBLISHING

TEACH YOURSELF
MAC C++ PROGRAMMING
IN 21 DAYS

Find out how to program in C++ using the Symantec C++ compiler

Learn how to develop GUI applications using the latest version of the THINK Class Library (TCL)

Explore the Visual Architect utility, a tool that makes it easier to create Mac programs

Covers Symantec C++ version 7.0 and THINK Class Library (TCL) version 2.0!

Kamir Shammas

No Previous Programming Knowledge Required!

Image description: A book cover with a dark green-to-black background, large white and yellow title type, a yellow starburst badge at top right, and a beige calculator and desk calendar with days 7, 14, and 21 highlighted in pink on a translucent overlay.

Reading notes: Left edge of the cover is cropped, so the first letters of the title and subtitle lines (e.g., 'TEACH', 'IN 21 DAYS', 'Learn', 'Explore', 'Kamir/Samir Shammas' author name) are partly cut off and reconstructed from visible fragments. Author name is partly obscured; the surname is read as 'Shammas' but the first name may be 'Kamir' or 'Samir' and is uncertain. Calendar numbers and small day-of-year figures in the background are not advertising copy and are included only as printed dates; their meaning is uncertain. Sams Publishing logo text is partly cropped at the left edge ('UBLISHING' visible).

Printed product names: Symantec C++ · THINK Class Library (TCL) · Visual Architect

Printed dates: 21 · 7

Languages: English

[Original PDF page 1](https://www.vintageapple.net/files/beb94f888f1f419795959e28bc672bd0f1636a543e0905916882a43f44dc852a/Teach_Yourself_Mac_C-_Programming_1994.pdf#page=1)

### PDF page 2

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-teach-yourself-mac-c-programming-1994-b286c4/1#scan-e98b9e23edbfd153aacd423eda801e98b0e856dc5061b6828d5d45b78f142eb8)

Transcribed text:

Get Acquainted   Examine C++   Learn about   Your programs   Give your   Need to repeat   Arrays are a
day. Take a tour   program   various C++   will improve   programs some   some code?   simple way to
of the Symantec   components in   operators and   when you learn   decision-making   It's easy if   group similar
C++ THINK   more detail as   expressions,   how to handle   power with   you put in a   pieces of data
Project   Manager   well as naming   including math,   user input and   the if and   loop. Today you   under a common
and see your first   and declaring   logical, and   output, including   switch   learn all you   name. Today you
program. In three   variables,   relational   the famous   statements   need to know   learn everything
weeks, you'll be a   constants, and   operators.   printf ()   covered today.   about loops.   about arrays-
Mac C++ expert.   functions.   statement.   even sorting them.
User-defined   If   you need to   You'll be able   Object-oriented   What if you   Today you are   The Visual
types   and pointers store words, use   to do more   programming   want to store   introduced to   Architect utility
are today's   strings. Today   with your   (OOP)   is one   program data in   programming   plays a vital role
topics. Learn   you learn the   functions after   of the   a file? You   Macintosh   in simplifying the
about structures   basics of strings   today's topic-   cornerstones   can with file   applications   process of creat-
and unions, and   and all the special   advanced   ofC++, and   stream   I/O   after   using the   ing Macintosh
unleash the   functions in   parameters   it's also   you learn all   THINK Class   programs,
power of   the STRING.H   of functions.   today's topic.   its basics today.   Library (TCL).   and you learn
pointers!   library.   some basics today.
Today presents   You create text   Today presents   The TCL classes   Today covers   Today'sTCL   This final lesson
very simple   in a window   the TCL classes   model the check   the TCL class   library classes   focuses on creating
TCL-based   using static text   that support   box and radio   that models   model the scroll   and using dialog
Macintosh   controls today   the edit controls   controls. You learn list box controls.   bar and the   boxes. You learn
applications. You   and learn how to   and pushbutton   how to use these   You also   pop-up menu   how to define
begin by creating   alter the controls'   controls.   controls and how   learn about   pane. A simple   dialog boxes
a minimal   font, size, and   to group multiple   single-selection   timer example   using the Visual
TCL program.   alignment at   radio controls.   list boxes.   is illustrated.   Architect utility.
runtime.

Reading notes: Source text is column-interleaved, so reading order across columns is uncertain. Some phrases such as 'Today's TCL' and 'ofC++' may be spacing artifacts from extraction.

Languages: English

[Original PDF page 2](https://www.vintageapple.net/files/beb94f888f1f419795959e28bc672bd0f1636a543e0905916882a43f44dc852a/Teach_Yourself_Mac_C-_Programming_1994.pdf#page=2)

### PDF page 3

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-teach-yourself-mac-c-programming-1994-b286c4/1#scan-efec6c8b94857ca0d90c10e1aae117eec327a9154bc6f4ef40183c1f8dbb89f9)

How to Use This Book

Transcribed text:

. How to   Use   This Book
Teach   Yourself   Mac   C++   Progra1flmingin21   Days   has two major goals: to teach
you how to program in C++ and to teach you how to create Macintosh app-
lications using Symantec C++. It uses some special features to guide you on
your Journey.
This book contains 21 chapters, one for each study day. Each day ends with a
Q&A   section containing answers to common questions related to the day's
material. There is also a workshop at the end of   each day which contains a quiz
and exercises. The quiz tests your knowledge of the concepts presented that
day, and the exercises put your new skills to use.
Syntax sections help you master a specific Symantec C++ topic. Note, Warn-
ing, and   DO/DON'T   boxes point out special considerations on the current
subject, and new terms are highlighted and collected in a glossary at the end of
the book.
The listings in this book are available from the author for those readers who
want to save the time of ryping them (see the order form in the back of the
book) .
This book will enable you to step boldly into the world of programming. It's
an exciting world that   gives   you more control over what your machine does.
Happy programming!
Conventions   Used   in   This Book
This book uses various rypefaces to help you differentiate between Symantec
C++ code and regular English, and also to help you identify important
concepts. Actual Symantec C++ code is rypeset in a special   monospace   font.
Placeholders-terms used to represent what you actually rype within the
code-are rypeset in an   italic monospace   font. New or important terms are
typeset in   italic.
There are three flavors of listings in this book, and each rype is denoted   by   a
special icon next to the listing's heading.
This icon indicates that you are to rype all the code in the listing.
This icon indicates that the Visual Architect utiliry automatically generates the
code for you, and you don't rype any of the code in the listing.
This icon indicates that the listing contains code generated automatically by
the Visual Architect utiliry   and   code that you need to rype. The lines of code
you are to rype are presented in a   bold   monospace   font.

Reading notes: OCR artifacts such as 'Progra1flmingin21' and 'rypeface' appear in the source text and may reflect damaged characters.

Printed product names: Symantec C++

Languages: English

[Original PDF page 3](https://www.vintageapple.net/files/beb94f888f1f419795959e28bc672bd0f1636a543e0905916882a43f44dc852a/Teach_Yourself_Mac_C-_Programming_1994.pdf#page=3)

### PDF page 4

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-teach-yourself-mac-c-programming-1994-b286c4/1#scan-685912aff39e33008780a2284a24e87c58a50b93a79f7fd19450db0f293ef89a)

Teach Yourself Mac C++ Programming in 21 Days

Transcribed text:

Teach
Yourself
Mac C++
Programming
in 21 Days

Image description: A white page with a black-bordered rectangle on the right containing a tall dark gray panel with white serif title text stacked in lines, divided by a thin white horizontal rule above 'in 21 Days'.

Reading notes: '21 Days' is a duration phrase in the title rather than a calendar date; listed under printedDates only because it is a visible numeric expression. Title is set in a stacked layout; line breaks follow the visible lines.

Printed product names: Mac C++ Programming

Printed dates: 21 Days

Languages: English

[Original PDF page 4](https://www.vintageapple.net/files/beb94f888f1f419795959e28bc672bd0f1636a543e0905916882a43f44dc852a/Teach_Yourself_Mac_C-_Programming_1994.pdf#page=4)

### PDF page 5

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-teach-yourself-mac-c-programming-1994-b286c4/1#scan-18b76d47fcf4f1e18d9ccab01601df3e0b30f6f7f4c30c0187e0cc992425507e)

Teach Yourself Mac C++ Programming in 21 Days

Transcribed text:

Teach Yourself
Mac C++
Programming
in 21 Days
Namir Clement Shammas
SAMS PUBLISHING
201 West 103rd Street, Indianapolis, Indiana 46290

Image description: Book title page with large black serif title text over a faded grey background graphic of a grid with letters and a grey vertical bar on the right edge, with the publisher logo and address at the bottom left.

Reading notes: Faint fine print on the upper portion of the page (copyright/publisher block) is too washed out to transcribe reliably and was omitted. The background grid letters (such as M, T, W, R, F, S) are decorative and partially obscured; they were not transcribed as text. Reading order of the title lines is inferred from layout.

Languages: English

[Original PDF page 5](https://www.vintageapple.net/files/beb94f888f1f419795959e28bc672bd0f1636a543e0905916882a43f44dc852a/Teach_Yourself_Mac_C-_Programming_1994.pdf#page=5)

### PDF page 6

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-teach-yourself-mac-c-programming-1994-b286c4/1#scan-1aa76423595bee72678c84d67905a49346f7f0e83fc7b1ffde5f658220feeee5)

Transcribed text:

To my dear   friend Ponnam,
whose soul never stops growing.
Copyright © 1994 by   Sams   Publishing
FIRST   EDITION
All rights reserved. No part of this book shall be reproduced, stored in a retrieval
system, or transmitted by any means, electronic, mechanical, photocopying,
recording, or otherwise, without written permission from the publisher. No patent
liability is assumed with respect to the use of the information contained herein.
Although every precaution has been taken in the preparation of this book, the
publisher and author assume no responsibility for errors or omissions. Neither is
any liability assumed for damages resulting from the use of the information
contained herein. For information, address   Sams   Publishing,   201   W.   103rd   St.,
Indianapolis, IN   46290.
International Standard Book Number:   0-672-30610-7
Library of Congress Catalog Card Number:   94-67504
97   96   95   4   3
Interpretation of the printing code: the rightmost double-digit number is the year
of the book's printing; the rightmost single-digit, the number of the book's
printing. For example, a printing code of 94-1 shows that the first printing of the
book occurred in 1994.
Composed in A Garamond and MCPdigital by Macmillan Computer Publishing
Printed in the   United   States ofAmerica
Trademarks
All terms mentioned in this book that are known to be trademarks or service
marks have been appropriately capitalized.   Sams   Publishing   cannot attest to the
accuracy of this information.   Use   of a term in this book should not be regarded as
affecting the validity of any trademark or service mark.

Reading notes: Copyright year 1994 and printing code 94-1 are explicit in the copy; no advertised products or prices appear. The printing code example '94-1' is part of the interpretation note rather than a printing date of this specific edition.

Printed dates: 1994 · 94-67504 · 94-1

Languages: English

[Original PDF page 6](https://www.vintageapple.net/files/beb94f888f1f419795959e28bc672bd0f1636a543e0905916882a43f44dc852a/Teach_Yourself_Mac_C-_Programming_1994.pdf#page=6)

### PDF page 7

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-teach-yourself-mac-c-programming-1994-b286c4/1#scan-3f8c1adb32345de2e0be16662a3a69888ed2d94628e99d723b112c53929e3d1a)

Transcribed text:

Publisher
Richard K   Swadley
Associate   Publisher
Jordan Gold
AcquisitionsManager
Stacy   Hiquet
Managing   Editor
Cindy Morrow
Acquisitions   Editor
Grace Buechlein
Development   Editor
Stacy   Hiquet
Production and
Copy Editor
Kristi Hart
Editorial   Coordinator
Bill Whitmer
Editorial Assistants
Carol Ackennan
Sharon   Cox
Lynette Quinn
Technical   Reviewer
BobZigon
Marketing Manager
Gregg Bushyeager
Cover Designer
Dan Armstrong
Book Designer
A(yssa   Yesh
Director of
Production   and
Manufacturing
Jeff Valier
Imprint   Manager
Juli Cook
Manufacturing
Coordinator
Paul   Gilchrist
ProductionAnalysts
Dennis Clay Hager
Mary Beth Wakefield
Graphics Image
Specialists
Stacey Beheler
Teresa Forrester
Clint Lahnen
Tim Montgomery
Dennis Sheehan
GregSimsic
Susan   Vande   Walle
Page   Layout
Elaine Brush
Steph   Davis
Rob   Falco
Angela   P.   Judy
Ayanna Lacey
Chad   Poore
Casey   Price
Kim   Scott
Marc Sheeter
Susan   Shepard
Scott   Tullis
Proofreading
Mona Brown
Ayrika Bryant
Amanda Byus
Cheryl   Cameron
Kimber(y   K Hannel
Greg Kemp
Brian-Kent Proffitt
Sharon Provart
Linda Quigley
Beth Rago
SA   Springer
Indexer
Jeanne   Clark

Reading notes: Credits list lacks a primary heading, so headline is null. Some names contain irregular spacing or possible OCR errors (e.g., 'Kimber(y   K Hannel', 'A(yssa   Yesh', 'Ackennan').

Languages: English

[Original PDF page 7](https://www.vintageapple.net/files/beb94f888f1f419795959e28bc672bd0f1636a543e0905916882a43f44dc852a/Teach_Yourself_Mac_C-_Programming_1994.pdf#page=7)

### PDF page 8

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-teach-yourself-mac-c-programming-1994-b286c4/1#scan-ae3f487d93440c6f86dcfc47224a6440a44fb254f413cb932c831dcfcca00a9b)

Transcribed text:

Overvie-wr
\Veek   1
Day
Introduction
at a Glance
Getting Started
2   C++   Program   Components
3   Operators and Expressions
4   Managing   I/ 0
5   Decision-Making Constructs
6   Loops
7   Arrays
'Veek   1 in   Review
\.Veek   2 at a Glance
Day   8
9
10
11
12
13
14
\Veek   2   in   Review
\Veek   3 at a Glance
Day   15
16
17
18   Grouped Controls
19   The List Box Control
20   The Scroll Bar and   Pop-up   Me
21   The Dialog Box
\Veek   3   in   Review
xxv
1
3
35
65

Reading notes: Overview heading appears damaged in OCR ("Overvie-wr") Reading order of week and day listings is uncertain

Languages: English

[Original PDF page 8](https://www.vintageapple.net/files/beb94f888f1f419795959e28bc672bd0f1636a543e0905916882a43f44dc852a/Teach_Yourself_Mac_C-_Programming_1994.pdf#page=8)

### PDF page 9

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-teach-yourself-mac-c-programming-1994-b286c4/1#scan-a38f23c8fb012e283835f5db0371cd028fe5c7b9b2d84cafdacf365f516dfe66)

Transcribed text:

Appendixes
A Resources 751
B Answers 759
Glossary 831
Index 839

Image description: A book page with a bold "Appendixes" heading at top left, a list of appendix entries with page numbers, faint ghosted table-of-contents text behind, and a large grey tilted graphic with a dark tab and grid lines at the left edge.

Reading notes: Faint ghosted text in the background (largely a table of contents with 'Contents' heading and chapter entries) is too faint to transcribe reliably and was omitted. The large tilted grey graphic at left has a partially visible letter on the dark tab that is not clearly readable. Layout is a book page rather than an advertisement; headline is interpreted as the 'Appendixes' heading but no separate headline is clearly present.

Languages: English

[Original PDF page 9](https://www.vintageapple.net/files/beb94f888f1f419795959e28bc672bd0f1636a543e0905916882a43f44dc852a/Teach_Yourself_Mac_C-_Programming_1994.pdf#page=9)

### PDF page 10

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-teach-yourself-mac-c-programming-1994-b286c4/1#scan-8d6923fe62c9747b0cf9edf6255e77b33e31f42d6073ac8b046ebd67ff97b1ed)

Transcribed text:

Contents

Introduction xxv
Week 1 at a Glance 1
Day 1 Getting Started 3
The Basics of C++ Programs 4
Loading the THINK Project Manager 5
An Overview of the THINK Project Manager 5
The Apple Menu 6
The File Menu 6
The New Command 7
The Open... Command 7
The Open Selection Command 8
The Close Command 8
The Save Command 8
The Save As... Command 9
The Save Copy As... Command 9
The Revert Command 9
The Page Setup... Command 9
The Print... Command 10
The Modify Read-Only Command 10
The Quit Command 10
The Edit Menu 11
The Undo Command 12
The Cut Command 12
The Copy Command 12
The Paste Command 12
The Clear Command 12
The Select All Command 12
The Options Command 13
The Set Tabs & Font... Command 13
The Shift Left Command 14
The Shift Right Command 14
The Balance Command 14
The Search Menu 14
The Find... Command 15
The Enter Selection Command 17
The Find Again Command 17
The Replace Command 17
The Replace & Find Again Command 17
The Replace All Command 17
The Find in Next File Command 18
The Find in THINK Reference Command 18
The Go to Line... Command 18
The Mark... Command 18

Image description: A book table-of-contents page with bold serif title 'Contents' at top, dotted-leader entries with page numbers, and a faint diagonal gray graphic reading 'THINK' letters in outlined blocks running across the page.

Reading notes: Faint background bleed-through from the reverse side of the page near the top right is not transcribed. The gray diagonal graphic overlaps some entry text and page numbers, so a few page numbers on the right side (e.g., 7, 8, 13, 14, 17, 18) may be partially obscured.

Languages: English

[Original PDF page 10](https://www.vintageapple.net/files/beb94f888f1f419795959e28bc672bd0f1636a543e0905916882a43f44dc852a/Teach_Yourself_Mac_C-_Programming_1994.pdf#page=10)

### PDF page 11

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-teach-yourself-mac-c-programming-1994-b286c4/1#scan-5567c88d0038ae7ef681b1951e7ac28611842cfa44e6bbf4ff4662291065fce5)

Transcribed text:

The Remove Marker. .. Command ........................... ... .... .. .................... 18
The Go To Next Error Command ........................... ............................ 19
The Go To   Previous   Error Command .... ..... ...................................... ... 19
The   Project   Menu ....... ..... ..................... ................... ........................ .. ....... 19
The Close   Project   Command ........................................... ....... ... ..........   20
The Close & Compact Command .................................. ........... .......... 21
The Switch To   Project   Command ......................................................... 21
The Set   Project   Type   ... Command ....................................................... 21
The Remove Objects Command .............. ............... .. ............................ 22
The Bring   Up   To Date Command ......................................... .............. 22
The Check Link Command ......................................... ................. ....... 22
The Build Application   ... Command ..................................................... 22
The   Use   Debugger Command .......... ....................................... ...... ....... 22
The Run Command .......... ..... ..... ... ..... .... ..... ...... .................................. 22
The Source Menu ........ ............... ....... ................... ............. ........... ............ 23
The Add Window Command .............. ... .. ..... .................. ......... ............ 24
The Add Files Command ............ .......... ........ ....... ................ ................ 24
2   C++   Program   Components   35
Predefined   Data Types in Symantec C++ ................. .. .....   .' ........ ................. 36
Naming Items in Symantec C++ ......... .......................................... .......... .. 38
The .#include   Directive ......... ........... ............ ..... .. ... .................................... 38
Declaring Variables ... ................ ..... ........ ... ......... ..... ...... ............................ 39
Declaring Constants ....... ......... ......... ..... .............................. ....... ............. .. 41
Using   Macro-Based Constants ...... .... ................ ....... ............................. 42
Using   Formal Constants ....... ..... ..... ................. ... ..... ........... ..... ....... ...... 44
Declaring and Prototyping Functions ........................................................ 45
Local Variables in Functions ........................ ............................ ................. 48

Reading notes: Table of contents with dotted leaders and irregular spacing; page numbers and some entries may be misaligned. Possible OCR spacing damage in several command names (e.g., 'Project   Menu', 'Build Application   ...').

Printed product names: Symantec C++

Languages: English

[Original PDF page 11](https://www.vintageapple.net/files/beb94f888f1f419795959e28bc672bd0f1636a543e0905916882a43f44dc852a/Teach_Yourself_Mac_C-_Programming_1994.pdf#page=11)

[Next transcribed scans](https://www.vintageapple.net/transcripts/media/va-teach-yourself-mac-c-programming-1994-b286c4/2.md)
