UMBC CMSC202, Computer Science II, Spring 1998,
Sections 0101, 0102, 0103, 0104 and Honors
Tuesday March 10 1998
Assigned Reading:
- A Book on C:
- Programming Abstractions in C:
Handouts (available on-line): none
Topics Covered:
-
More discussion on Project 3.
- We paid special attention to the implementation notes and
the submission instructions.
- Also, mentioned the existence of the Project 3 notes page.
- Simple sample files are available to test your projects.
They are in the directory ~chang/pub/cs202/proj3/ on
the GL file system. The sample main
program checks the sparse matrix operations on these
simple test cases. The README file
explains all.
- You can also find the source code
for a program that generates random sparse matrices.
- You can use the implementation of the
dense matrix operations to test your sparse matrix functions on
large matrices. A sample main program
shows how. (See also: Header file for
dense matrix operations.)
-
We discussed how the DCrashOnNull() function in
dense.c uses void * pointers.
In this case, it is convenient to forget about the types of pointers.
We also examined in detail the use of the free() function
in the FreeDense() function.
-
Long discussion about Abstract Data Types and what they are good for.
We looked at an example of a main
program that uses two abstract data types adt1 and adt2. In the implementations of these
two ADT's, adt1.c and adt2.c, (which in this simple case, just
involves a few integer variables), we have some private functions
and some public functions. Private functions are designated by
the keyword "static". Since private functions can only be used
by other functions in the same file. Thus, there is no difficulty
with the fact that both ADT implementations contain a function called
non_unique_func_name(). The sample
run shows that the functions in adt1.c call the
non_unique_func_name() defined in adt1.c and the functions
in adt2.c use the one defined in adt2.c. Similarly, private global
variables can have the same name. Private global variables are
also declared using the keyword "static". Attempts to
access private global variables from the main
program results in compilation
errors.
Last Modified:
22 Jul 2024 11:27:45 EDT
by
Richard Chang
Back up
to Spring 1998 CMSC 202 Section Homepage