Pascal Pointers Read Me
Pascal Pointers Read Me
Read Me & Reference · PDF
| Filename | Pascal_Pointers_ReadMe.pdf |
|---|---|
| Size | 0.09 MB |
| Subsection | Pascal Pointers |
| Downloads | 0 |
Enjoying MacTrove?
Anonymous downloads are free and unlimited.
Create a free account to track favorites,
contribute metadata corrections, and join the
community chat.
Reader
Loading…
OCR / Text contents
Pascal Pointers
and Dynamic Variables
Demonstration Package
Dr. Jeffrey L. Popyack
Assistant Professor
Department of Mathematics
and Computer Science
Drexel University
Philadelphia, PA 19104
(215) 895-2668
1. Introduction:
This package is intended to provide users with a mechanism for learning to
use pointers and dynamic variables in Pascal. The concept arose from the
great deal of difficulty students have exhibited in learning this material in
programming courses. This material is fundamental for further computer
science work, yet often is not learned by students, partially because it is easier
for the programmer to find an alternative way to implement his program than it
is to learn the more elegant (and often more efficient) methods associated with
dynamic variables.
The package is designed as follows: The user is supplied with a display
which shows an initial data structure. The display is similar to that used in most
Pascal textbooks. The user is allowed to enter commands from a subset of
Pascal commands which use pointer variables. As each command is entered,
the display is updated to demonstrate the effect of the command on the given
structure. Syntax and semantic errors are detected by the interpreter, with
appropriate diagnostics. Some on-line help is also provided. A set of lessons
is available, each of which provides some initial structure, and asks the user to
alter the structure in some way. The user is not required to perform the
lessons, however; this package is designed for use as a general tool which will
correctly interpret and display any sequence of pointer-type commands. This
package may therefore be used by an instructor for classroom demonstration.
The instructor may also use the package to create additional lessons.
The remainder of this report is organized as follows: Section 2 contains an
explanation of pointers and dynamic variables in Pascal, and may be bypassed
by the reader who is already familiar with this material. Section 3 contains
instructions for using Pointer Demo and Section 4 shows a sample session.
1
2. About Pascal's Pointer Variables:
Persons familiar with the concept of dynamic variables and pointers in
Pascal may proceed to Section 3.
Pascal allows the use of variable types that do not exist in some other
languages, such as BASIC and FORTRAN. The user is also allowed to create
new types for use in his program. One popular mechanism is the record
structure, which allows a variable to have several components, each of which
may have its own type. For instance, the declaration
type
StockHolder = record
name : string[20] ;
…
Showing first 3,000 characters of 27,196 total. Open the full document →