You are on page 1of 9

11/10/13

A Beginners C++

11/10/13 A Beginners C++ This page contains information concerning a draft version of a book "AJavaworld you will usually find that they have dowloadable copies of gzip utilities for both Mac and PC available on their page. The links are at the bottom after their stories about Java developments.) (If you need a viewer for postscript, try: University Wisconsin, ghostscript, ghostview, gs page ) The postscript files have been "distilled" into Adobe PDF files. This makes them smaller, and so easier to download; it should also make them easier to read on a variety of systems. Preface (PDF of table of contents) www.uow.edu.au/~/nabg/ABC/ABC.html 1/9 " id="pdf-obj-0-6" src="pdf-obj-0-6.jpg">
11/10/13 A Beginners C++ This page contains information concerning a draft version of a book "AJavaworld you will usually find that they have dowloadable copies of gzip utilities for both Mac and PC available on their page. The links are at the bottom after their stories about Java developments.) (If you need a viewer for postscript, try: University Wisconsin, ghostscript, ghostview, gs page ) The postscript files have been "distilled" into Adobe PDF files. This makes them smaller, and so easier to download; it should also make them easier to read on a variety of systems. Preface (PDF of table of contents) www.uow.edu.au/~/nabg/ABC/ABC.html 1/9 " id="pdf-obj-0-9" src="pdf-obj-0-9.jpg">

This page contains information concerning a draft version of a book "A Beginners' C++"; this book is intended for "CS1, CS2" introductory Computer Science courses that use C++ as an implementation language.

11/10/13 A Beginners C++ This page contains information concerning a draft version of a book "AJavaworld you will usually find that they have dowloadable copies of gzip utilities for both Mac and PC available on their page. The links are at the bottom after their stories about Java developments.) (If you need a viewer for postscript, try: University Wisconsin, ghostscript, ghostview, gs page ) The postscript files have been "distilled" into Adobe PDF files. This makes them smaller, and so easier to download; it should also make them easier to read on a variety of systems. Preface (PDF of table of contents) www.uow.edu.au/~/nabg/ABC/ABC.html 1/9 " id="pdf-obj-0-15" src="pdf-obj-0-15.jpg">

Note: this text was completed in 1996. C++ has been revised quite a bit since then! When the examples were written, C++'s "namespace" feature had been defined but was not supported on available compilers; so the examples don't use namespace. (Of course, in modern C++ they should.) Further, the iostream library has been updated. Some of the functions have changed their signatures; some features have been added, others removed. So, be cautious with the code - it is well a little out of date.

11/10/13 A Beginners C++ This page contains information concerning a draft version of a book "AJavaworld you will usually find that they have dowloadable copies of gzip utilities for both Mac and PC available on their page. The links are at the bottom after their stories about Java developments.) (If you need a viewer for postscript, try: University Wisconsin, ghostscript, ghostview, gs page ) The postscript files have been "distilled" into Adobe PDF files. This makes them smaller, and so easier to download; it should also make them easier to read on a variety of systems. Preface (PDF of table of contents) www.uow.edu.au/~/nabg/ABC/ABC.html 1/9 " id="pdf-obj-0-21" src="pdf-obj-0-21.jpg">

A Beginners C++

The table of contents given below includes links to additional materials. Some complete chapters, and various subsections, are available either as Postscript files or directly readable "html" text. There are also links to a couple of files with example code. The code should be usable with the Borland development environment for the PC, or Symantec-8 for the Macintosh.

To save space and transmission time, many of the Postscript files have been compressed. The files were compressed using gzip on Unix. You have to uncompress them (gunzip) before viewing them with ghostview or sending to a printer. (If you go to Javaworld you will usually find that they have dowloadable copies of gzip utilities for both Mac and PC available on their page. The links are at the bottom after their stories about Java developments.) (If you need a viewer for postscript, try: University Wisconsin, ghostscript, ghostview, gs page )

11/10/13 A Beginners C++ This page contains information concerning a draft version of a book "AJavaworld you will usually find that they have dowloadable copies of gzip utilities for both Mac and PC available on their page. The links are at the bottom after their stories about Java developments.) (If you need a viewer for postscript, try: University Wisconsin, ghostscript, ghostview, gs page ) The postscript files have been "distilled" into Adobe PDF files. This makes them smaller, and so easier to download; it should also make them easier to read on a variety of systems. Preface (PDF of table of contents) www.uow.edu.au/~/nabg/ABC/ABC.html 1/9 " id="pdf-obj-0-35" src="pdf-obj-0-35.jpg">

The postscript files have been "distilled" into Adobe PDF files. This makes them smaller, and so easier to download; it should also make them easier to read on a variety of systems.

11/10/13 A Beginners C++ This page contains information concerning a draft version of a book "AJavaworld you will usually find that they have dowloadable copies of gzip utilities for both Mac and PC available on their page. The links are at the bottom after their stories about Java developments.) (If you need a viewer for postscript, try: University Wisconsin, ghostscript, ghostview, gs page ) The postscript files have been "distilled" into Adobe PDF files. This makes them smaller, and so easier to download; it should also make them easier to read on a variety of systems. Preface (PDF of table of contents) www.uow.edu.au/~/nabg/ABC/ABC.html 1/9 " id="pdf-obj-0-41" src="pdf-obj-0-41.jpg">

11/10/13

Part 1 Introduction to Computers

  • 1. Computer Hardware

A Beginners C++

  • 1. CPU and instructions

  • 2. Memory and Data

  • 3. Bus

  • 4. Peripherals

  • 5. Disks and tapes

  • 6. Other I/O devices

  • 2. Programs: Instructions in the Computer (PDF of chapter)

    • 1. Programming with bits!

    • 2. Loaders

    • 3. Assemblers

    • 4. Coding in assembly language

    • 5. From Assembly Language to "High Level" languages

    • 1. Origins of "Operating Systems"

    • 2. Development of Operating Systems: Multiprogramming* Timesharing* File Management* Virtual Memory* "Spooling"* Late 1960s early 1970s system* Networking*

    • 3. Modern systems: UNIX* Macintosh OS*

    • 4. Why have "high-level" languages? (Postscript file of chapter)

      • 1. Limitations of Assembly Language and Origins of High Level Languages

      • 2. High level languages constructs: Statements* Data types and structures*

      • 3. Evolution of high level languages

      • 4. FORTRAN

      • 5. BASIC

      • 6. Lisp

      • 7. COBOL

      • 8. ALGOL

    11/10/13

    A Beginners C++

    • 9. The "Algol Family":AlgolW, Pascal, and Modula2* ADA* BCPL, C, and C++* Simula, SmallTalk, and Eiffel*

    • 5. C++ development environment (Postscript file of chapter)

      • 1. Integrated Development Environment

      • 2. C++ input and output

      • 3. A simple example program in C++:Design* Implementation*

    11/10/13 A Beginners C++ 9. The "Algol Family":AlgolW, Pascal, and Modula2* ADA* BCPL, C, and C++*(PDF of chapter) 5. C++ development environment (Postscript file of chapter) 1. Integrated Development Environment 2. C++ input and output 3. A simple example program in C++:Design* Implementation* (PDF of chapter) Part 2 Simple Programs 6. Sequence (PDF of chapter) 1. Overall structure and main() Function 2. Comments 3. Variable definitions 4. Statements 5. Examples: "Exchange rates"* pH* 6. Naming rules for variables 7. Constants 8. Initialization of Variables 9. Converting data values 7. Iteration (PDF of chapter) 1. While loops 2. Examples: Modelling the decay of CFC gases* Newton's method for finding a square root* Tabulating function values* 3. Blocks 4. "Boolean" variables and expressions True and False* Expressions using "AND"s and "OR"s* 5. Short forms: C/C++ abbreviations 6. ... Do while 7. For loop 8. Break and Continue statements 8. Selection (PDF of chapter) 1. Making choices 2. A realistic program: Desk Calculator 3. IF... www.uow.edu.au/~/nabg/ABC/ABC.html 3/9 " id="pdf-obj-2-22" src="pdf-obj-2-22.jpg">

    Part 2 Simple Programs

    • 6. Sequence (PDF of chapter)

      • 1. Overall structure and main() Function

      • 2. Comments

      • 3. Variable definitions

      • 4. Statements

      • 5. Examples: "Exchange rates"* pH*

      • 6. Naming rules for variables

      • 7. Constants

      • 8. Initialization of Variables

      • 9. Converting data values

  • 7. Iteration (PDF of chapter)

    • 1. While loops

    • 2. Examples: Modelling the decay of CFC gases* Newton's method for finding a square root* Tabulating function values*

    • 3. Blocks

    • 4. "Boolean" variables and expressions True and False* Expressions using "AND"s and "OR"s*

    • 5. Short forms: C/C++ abbreviations

    • 6. ...

    Do

    while

    • 7. For loop

    • 8. Break and Continue statements

    • 1. Making choices

    • 3. IF...

    11/10/13

    • 4. Terminating a program

    A Beginners C++

    • 5. Example Programs: Calculating some simple statistics* Newton's method for roots of polynomials*

    • 6. What is the Largest? What is the Smallest?

    • 9. Simple use of files

      • 1. Dealing with more data

    11/10/13 4. Terminating a program A Beginners C++ 5. Example Programs: Calculating some simple statistics* Newton's(html text of most of section on files) (PDF of chapter) Part 3 Functions and Data Aggregates 10. Functions (PDF of chapter) 1. Form of a function Definition 2. Result types 3. Function declarations 4. Default argument values 5. Type safe linkage, Overloading, and Name Mangling 6. How functions work 7. Inline functions 8. A recursive function 9. Examples of simple functions: GetIntegerInRange* Newton's square root algorithm as a function* 10. The rand() function 11. Examples: pi-Canon* (html text of section introducing coding example) , (text file with all code for pi-cannon) Function plotter* 11. Arrays (Postscript file of chapter) 1. Defining one dimensional arrays 2. Initializing one dimensional arrays 3. Simple Examples Using One-Dimensional arrays: Histogram* Plotting once more* 4. Arrays as arguments to functions 5. Strings: Arrays of characters www.uow.edu.au/~/nabg/ABC/ABC.html 4/9 " id="pdf-obj-3-33" src="pdf-obj-3-33.jpg">

    Part 3 Functions and Data Aggregates

    • 10. Functions (PDF of chapter)

      • 1. Form of a function Definition

      • 2. Result types

      • 3. Function declarations

      • 4. Default argument values

      • 5. Type safe linkage, Overloading, and Name Mangling

      • 6. How functions work

      • 7. Inline functions

      • 8. A recursive function

      • 9. Examples of simple functions: GetIntegerInRange* Newton's square root algorithm as a function*

    • 1. Defining one dimensional arrays

    • 2. Initializing one dimensional arrays

    • 3. Simple Examples Using One-Dimensional arrays: Histogram* Plotting once more*

    • 4. Arrays as arguments to functions

    • 5. Strings: Arrays of characters

  • 11/10/13

    A Beginners C++

    • 6. Multi-dimensional arrays: Definition and initialization* Accessing individual elements* As arguments to functions*

    • 7. Arrays of Fixed length Strings

    • 8. Examples using arrays: Letter Counts* Simple encryption* Simple image processing*

    • 1. The "Code Coverage" Tool

    • 2. The Profiler

    • 15. Design and documentation : 1

      • 1. Top down functional decomposition

      • 2. Documenting a design

    • 17. Examples using structs

      • 1. Reordering the class list again

    11/10/13

    • 2. Points and Rectangles

    • 3. File of Records

    A Beginners C++

    11/10/13 2. Points and Rectangles 3. File of Records <a href=(PDF for chapter) A Beginners C++ 18. Bits and pieces (Postscript file for chapter explaining role of bit-level operations in C/C++) 1. Bit manipulations 2. Making a Hash of it: Example hashing function for a character string* A simple "hash table"* Example: identifying the commonly used words* 3. Coding "Property Vectors" 4. Pieces (Bit fields) (PDF of chapter) Part 4 A Touch of Class 19. Beginners' Class 1. Class declarations and definitions: Form of a class declaration* Defining the member functions* Using class instances* Initialization and "constructor" functions* const member functions* inline member functions* 2. Example: Bitmaps (Sets) 3. Numbers - a more complex form of data (details of a class for +, -, *, /, on 100 digit numbers; as a postscript file) code of multidigit arithmetic class 4. A glance at the "iostream" classes (PDF of chapter) 20. Dynamic data and pointers (Postscript file of chapter) 1. The "Heap" 2. Pointers: Some "pointer" basics* Using pointers* Strings and hash tables revisited* 3. Example: "Air Traffic Controller" 4. The "address of" operator 5. Pointers and Arrays 6. Building Networks (PDF of chapter) 21. Collections of dat a (postscript file of chapter presenting several standard "collection class" abstract types) 1. Class Queue 2. Class PriorityQueue 3. Class DynamicArray (code in C29 and C30 examples) 4. Class List 5. Class BinaryTree (code in C23 iterators example) www.uow.edu.au/~/nabg/ABC/ABC.html 6/9 " id="pdf-obj-5-25" src="pdf-obj-5-25.jpg">

    Part 4 A Touch of Class

    • 20. Dynamic data and pointers (Postscript file of chapter)

      • 1. The "Heap"

      • 2. Pointers: Some "pointer" basics* Using pointers* Strings and hash tables revisited*

      • 3. Example: "Air Traffic Controller"

      • 4. The "address of" operator

      • 5. Pointers and Arrays

      • 6. Building Networks

    11/10/13

    • 6. Collection class Libraries

    • 22. A World of Interacting Objects

      • 1. RefCards: Design* Implementation*

    A Beginners C++

    • 2. InfoStore: Initial design outline for InfoStore* Design and Implementation of the Vocabulary class* Other classes in the InfoStore program* Final class design for the InfoStore program

      • 1. A general function and its specializations

      • 2. Language Extensions for Templates:Template declaration* Template instantiation*

      • 3. Specialized Instantiations of Template Code

      • 4. A Template Version of QuickSort

      • 5. The Template Class "Bounded Array"

      • 6. The Template Class Queue

    11/10/13

    A Beginners C++

    • 3. Identifying the Exceptions that you intend to throw

    • 27. Example: Supermarket

      • 1. Background and Program Specification/li>

      • 2. Design: Design preliminaries* Scenarios: identifying objects, their classes, their responsibilities, their data* Filling out the definitions of the classes for a partial implementation*

      • 3. A partial implementation

      • 4. Finalising the Design: Histograms* Simulating the checkouts and their queues* Organizing the checkouts*

    • 28. Design and documentation: 2

      • 1. Object-Based Design

      • 2. Documenting a design

    11/10/13 A Beginners C++ 3. Identifying the Exceptions that you intend to throw <a href=(PDF of chapter) 27. Example: Supermarket 1. Background and Program Specification/li> 2. Design: Design preliminaries* Scenarios: identifying objects, their classes, their responsibilities, their data* Filling out the definitions of the classes for a partial implementation* 3. A partial implementation 4. Finalising the Design: Histograms* Simulating the checkouts and their queues* Organizing the checkouts* (PDF of chapter) 28. Design and documentation: 2 1. Object-Based Design 2. Documenting a design (PDF of chapter) Part 5 Object Oriented Programming (Paper describing approach to teaching OO) 29. The Power of Inheritance and Polymorphism (postscript file, of chapter with example illustrating use of inheritance and polymorphism) 1. The "Dungeon" Game 2. Design: Preliminaries* WindowRep and Window classes* DungeonItem hierarchy*(html text of chapter with example illustraing inheritance) 3. An implementation: Windows classes* Class Dungeon* DungeonItems*( html text of chapter with example illustraing inheritance) , (the code for "dungeon game" example) (PDF of chapter) 30. Reusable designs 1. The RecordFile Framework: Concepts (html text) 2. The Framework classes: Overview 3. The Command Handler Classes: Class declarations* Interactions* Implementation Code* 4. Collection Classes and their Adapters* 5. Class Record 6. The Windows Class Hierarchy: Class Responsibilities* Implementation Code* Using the concrete classes from a framework* 7. Organizational Details (Student Rec application, example use of a framework) (code for a simplified framework class library and application) (PDF of chapter) 31. Frameworks for understandin g (Postscript file introducing standard framework class libraries) www.uow.edu.au/~/nabg/ABC/ABC.html 8/9 " id="pdf-obj-7-31" src="pdf-obj-7-31.jpg">

    Part 5 Object Oriented Programming

  • 11/10/13

    • 1. "Resources" and "Macros"

    • 2. Architects, Experts, and Wizards

    • 3. Graphics

    • 4. Persistent Data

    • 5. The Event Handlers

    • 6. The Same Patterns in the code

    A Beginners C++

    Please email questions to nabg@cs.uow.edu.au