For this assignment you will write two functions. The first has numerous pointer parameters through which the function can change the values of variables that were declared outside of the function itself. Through these pointers, the function effectively returns multiple values, even though nothing is actually returned. See the sum_and_average()
function from the video code for a starting point.
The other function swaps two values given pointers to the values. To perform the swap you will need to use a temporary variable as you did in the reverse_string_in_place()
function from the last homework.
This assignment has a Makefile
, so you can build the code by running make
, and run the executable with ./pointer_parameters
.
The prototypes and documentation for the functions are in pointer_parameters.h
. Implement the functions in pointer_parameters.c
.
main.c
contains code which will test stats()
. Write your own code to test swap()
at the end of main()
.
You can run the GitHub testing locally with the command:
make gh-test-pointer-parameters
Push your submission to GitHub.
Your grade for this assignment will be out out of 10 points:
main()
contains code that demonstrates that swap()
works correctly