UMBC CMSC201, Computer Science I, Fall 1994
Sections 0101, 0102 and Honors
Thursday October 13, 1994
Assigned Reading: 5.4 - 5.5
Handouts (available on-line): none
Topics Covered:
- Attendance was taken. This is worth 1% of your final grade.
- Trace through another example of function calls from a previous
midterm exam.
The question and
solution.
- Reviewed the importance of using function prototypes.
Here's a program that doesn't use
function prototypes. Strange output
is produced. The modified program
works correctly when the function prototype for add3 is put in
(sample run of the corrected program).
- A function that computes the value of a raised to power b.
Program and
sample run.
If you typed man exp in UNIX, you would have noticed that there
is already a function (called pow) that computes a raised to the
power b. The manual entry for
"exp" begins with an explanation of "exp" for FORTRAN, ignore
this.
Last Modified:
Tue Oct 18 16:37:01 EDT 1994
Richard Chang, chang@gl.umbc.edu