Back to DFS's C Page
OAC Problem Set V
Starting to Use Functions
Due: Beginning of Class on 22 Nov 99
Before you commence programming, study the simple, introductory functions page.
With your partner from the previous problem set, you are to write two programs by cannibalizing the code provided on the pages linked to below. Both of your programs are to get dimensions of a rectangle from the user and then calculate and report its area and perimeter.
- Reading the information and making use of the code in Functions II, learn how addresses of variables are passed to a function so that the variable in the calling function can be changed. This is done with &, the address operator. Also you should learn how values are assigned using the pointer variable in the function called. This is done with *, the indirection operator or dereferencing operator. Use the Display and/or Print buttons of xxgdb to observe the values being passed, assigned and used.
- After reading the information in Functions III and tracing through the program provided, copy and modify the program you have completed above so that your program ensures that valid data comes from the user.
Created 16 Nov 1999
© 1999 DFStermole