UP ONE LEVEL:
ENGG 335 Home Page
ENGG 335 Fall 1998
Summaries of L02 Lecture Topics
This page is maintained by
Steve Norman
Last modified: Mon Dec 7 16:04:42 MST 1998
Note carefully!
I will not be putting my lecture notes
on line.
I expect students to attend lectures.
If you miss a lecture, the best way to get the lecture
notes is to borrow them from a fellow student.
Lecture content in Section L01 (Dr. Turner's section) will
be very similar to that of L02.
Numbers listed after ``related reading'' are section numbers
from the course text.
The organization of material in lectures does not
exactly match the organization of material in the textbook,
so when I list ``related reading'', I can't be completely precise.
In some cases using the index or table of contents will help
you find additional information.
Here is a link to the current week's lectures.
Week 1
- Lecture #1 (Wed., Sept. 9)
-
Welcome to ENGG 335.
Explanation of policies on the course outline.
Related reading: none.
- Lecture #2 (Fri., Sept. 11)
-
C++ source file organization in ENGG 335:
main program files, module interface files
and module implementation files.
Related Reading:
Week 2
- Lecture #3 (Mon., Sept. 14)
-
True and false in C++; using numerical values for
true and false.
Some simple array problems,
including deciding whether all elements in an
array are different from all others.
Related Reading:
- Lecture #4 (Wed., Sept. 16)
-
The idea of procedural abstraction.
A principle for function documentation.
The REQUIRES/PROMISES format for function
interface comments in ENGG 335.
Related Reading:
- Lecture #5 (Fri., Sept. 18)
-
A first step in visualizing memory use--diagrams of
activation records and the stack.
Graphical representations for call-by-value
and call-by-reference.
Related Reading:
Week 3
- Lecture #6 (Mon., Sept. 21)
-
Computer memory organization: a giant array of bytes.
Variable storage in blocks of bytes, addresses of variables.
Introduction to pointer variables.
Related Reading:
- Lecture #7 (Wed., Sept. 23)
-
Example programs: simple use of pointer variables,
simple use of pointers as function arguments.
Related Reading:
- Lecture #8 (Fri., Sept. 25)
-
Introduction to built-in arrays.
The char type: a type for storing
small integers.
Character codes.
Introduction to the ASCII character set.
Related Reading:
Week 4
- Lecture #9 (Mon., Sept. 28)
-
Built-in character strings.
Building a string one char at a time.
The strcpy function.
Explanations of why the arguments to strcpy
are pointers.
A definition for strcpy.
Related Reading:
- Lecture #10 (Wed., Sept. 30)
-
More about strcpy: how the return value can be used.
Use of const to make arguments
references-to-const-things or
pointers-to-const-things.
A key fact about arguments declared to be arrays--they're
really pointers.
Related Reading:
- Lecture #11 (Fri., Oct. 2)
-
Initialization vs. Assignment.
Some rules related to initialization of arrays and pointers.
Arrangement of array elements in computer memory.
Related Reading:
Week 5
- Lecture #12 (Mon., Oct. 5)
-
Pointer arithmetic: meanings for
pointer+int, pointer++, pointer-pointer,
pointer++, pointer--.
Example uses of pointer arithmetic.
Related Reading:
- Lecture #13 (Wed., Oct. 7)
-
Terminology: what is a class
and what is an object?
Introduction to classes--a simple example
showing a member variable and some member functions,
including a default constructor.
Related Reading:
- Lecture #14 (Fri., Oct. 9)
-
const vs. non-const member functions of classes.
Access control: public vs. private.
Class design--thinking about what operations an object
of the class can perform.
Example: AList class from Lab 5 Exercise E.
Related Reading:
Week 6
- Lecture #15 (Wed., Oct. 14)
-
Continued discussion of the example from Lecture #14.
Pointers to struct variables and objects--basic concepts,
use of the -> operator.
Related Reading:
- Lecture #16 (Fri., Oct. 16)
-
A bit more about pointers to struct variables and objects.
The this pointer--an implicit argument to member functions.
A very brief review of the uses we've seen so far for pointers.
Related Reading:
Week 7
- Lecture #17 (Mon., Oct. 19)
-
Memory allocation and deallocation--different rules
for the stack, static storage, and free store.
Use of new to allocate an array in the free store.
Related Reading:
- Lecture #18 (Wed., Oct. 21)
-
Use of delete to recycle free store memory.
Syntax summary for use of new and delete
with single variables and arrays.
One way to reduce the risk of dynamic allocation foul-ups:
allocate and deallocate within class member functions only,
and make sure classes have a well-defined memory allocation
strategy.
Related Reading:
- Lecture #19 (Fri., Oct. 23)
-
Example of a class that uses free store memory:
the StringOne class.
What destructor functions are for.
Related Reading:
Week 8
- Lecture #20 (Mon., Oct. 26)
-
Copying objects.
Effects of memberwise copying.
How to avoid memberwise copying.
An example of a copy constructor.
Various ways in which a copy ctor can be called.
Related Reading:
- Lecture #21 (Wed., Oct. 28)
-
Goals in writing an assignment operator.
Avoiding self-assignment.
Supporting chaining.
Reference types as function return types.
Example assignment operator code.
Related Reading:
- Lecture #22 (Fri., Oct. 30)
-
Concluding remarks on the copy constructor and the assignment
operator.
The Big 3: copy ctor,dtor, operator =.
The null pointer.
Introduction to linked lists.
Related Reading:
Week 9
- Lecture #23 (Mon., Nov. 2)
-
Short-circuit evaluation of expressions involving &&
and ||.
insert function for OLList
(ordered linked list) class.
Related Reading:
- Lecture #24 (Wed., Nov. 4)
-
remove function for OLList class.
The Big 3 for the OLList class.
(Introduction only--the hard work is done by students in
Lab 8.)
Related Reading:
- Lecture #25 (Fri., Nov. 6)
-
Implicit conversion for built-in types.
Implicit conversion for class types using
one-argument constructors.
Use of unnmaed temporary objects to initialize
reference arguments.
Related Reading:
Week 10
- Lecture #26 (Mon., Nov. 9)
-
Brief notes on explcit type conversion.
Comparison of approaches to program design,
especially procedural decomposition
and object-based programming.
Related Reading:
Week 11
- Lecture #27 (Mon., Nov. 16)
-
Class relationships:
composition, type parametrization, inheritance.
Inheritance and the IS-A concept.
Inheritance and member variables--base class subobjects.
Related Reading:
- Lecture #28 (Wed., Nov. 18)
-
Inheritance and member functions--rules for regular
member functions, special rules for constructors.
References, pointers and the IS-A relationship:
ref-to-base and ptr-to-base types can refer/point to
base class objects.
Related Reading:
- Lecture #29 (Fri., Nov. 20)
-
The difference between static and dynamic binding.
Virtual functions.
Pure virtual functions and abstract base classes.
Related Reading:
Week 12
- Lecture #30 (Mon., Nov. 23)
-
A few remarks about Lab 9 Exercise D.
Concluding remarks about inheritance and a very short
introduction to inheritance concepts not covered in ENGG 335.
Introduction to pointers to pointers and a simple example.
Related Reading:
- Lecture #31 (Wed., Nov. 25)
-
Arrays of pointers.
Detailed explanation of an example involving an
array of pointers to beginnings of strings.
Related Reading:
- Lecture #32 (Fri., Nov. 27)
-
Introduction to recursion--solving a problem using
the solution to a similar problem of the same kind.
Related Reading:
Week 13
- Lecture #33 (Mon., Nov. 30)
-
How recursion works--each recursive call creates
a new activation record.
Some examples of recursive functions.
Related Reading:
- Lecture #34 (Wed., Dec. 2)
-
An outline of the quicksort algorithm;
remarks on the importance of choosing a fast
algorithm when data sets are large.
Suggestions for the design of recursive solutions.
Related Reading:
- Lecture #35 (Fri., Dec. 4)
-
Efficiency of memory allocation strategies
for array classes.
Some general remarks on what is and is not covered
in ENGG 233 and ENGG 335.
Related Reading:
Week 14
- Lecture #36 (Mon., Dec. 7)
-
Review
Related Reading:
Jump to the top of this page.