← Programming Primer for the Macintosh 1995

Programming Primer for the Macintosh 1995

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.

PDF page 12

Contents xi Why You May Not Want to Lock a Handle . . . . . . . . . . . . . . . . . . . . . . 220 Low-Memory Global Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 Chapter 11 Object-Oriented Programming ........ 223 OOP and C++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225 Declaring and Instance Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225 Referencing Data Members of Individual Structures . . . . . . . . . . . . . . 226 Member Functions and Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226 Encapsulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 Data Hiding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230 Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230 Objects .. .... ...... .. .. .. , . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231 Instance Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 Messages ...... ... : . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234 Access or . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234 Constructor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234 Destructor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 The New and Delete Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236 Friends ....... _ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236 Linked List Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237 Designing the List Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239 Using the TList and TNode Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241 Derived Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243 Pointers and Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 Traditional or Object Programming: When to Use E ach . . . . . . . . . . . . . . 249 Class Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250 Chapter 12 Debugging and Finder Resources ..... 251 Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 Types of Bugs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 Debuggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 Symantec C++ Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 BOMBS!!! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256 Finder Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258

Reading notes: Some page numbers and dot leaders in the table of contents are garbled or irregular, e.g. 'Objects .. .... ...... .. .. .. ,' and 'Messages ...... ... :' Chapter entry 'Pointers and Objects' and 'Traditional or Object Programming' contain irregular letter spacing that may affect exact reading

Languages
English