Lecture 12 - October 4th
Discussed the
completed outlines submitted.
Talked a little
about chapter 5
Discussed the
grading of the output produced by your programs
Talked about
static and dynamic scope rules
what
variables are known where under each type of rule
Discussed the
importance of using the term non-local
rather than global for variables not
declared in a given program block.
Beginning of Chapter
5 outline
Chapter 5 is really about Identifiers (i.e. variables and
constants)
Identifiers
- length
- case
sensitivity
- key
or reserved words
- name
forms
- writability problems
- keyword
is special only in certain contexts
- reserved
words may not be used as identifiers
- required
first character type
- other
allowable characters
- before
FORTRAN90 names could have spaces which were ignored
- variables
- what are they?
- cell
or collection of cells
- what are their attributes?
- name
- address
- what
is it
- machine
memory address with which it is associated
- same
name may be associated with different addresses dependent on where it occurs in a program
(subprograms)
- same
name may be associated with different addresses dependent on when it occurs in a program
(stack)
- l-value
- aliases
- C and
C++ union types
- pointers
- subprogram
parameters
- type
- determines
range of values
- determines
operations that can be performed
- value
- physical
contents of memory cell or cells associated with the variable
- abstract
contents of memory cell
- r-value
- lifetime
- how long is it resident in memory?
- scope
- where in the program is it known?