CS 312 Lab 2: Makefile and multiple source files
- Write a program that is split into three files:
- input.c (and associated input.h), which declares and defines
a function read_int which reads an integer from stdin and stores it in
a global array.
- output.c (and associated output.h), which declares and
defines a function print_array which prints all the integers in the
global array, if any, out to stdout.
- main.c (and associated main.h), which calls read_int 10 times
and then print_array. It also keeps two global variables that is shared
across the files, an integer array as well as an index of the next free
element in the array.
- You should also write a Makefile to compile the files.
What to turn in
Place your code into a directory named LastnameFirstname-Lab2.
For
example,
my
directory
would
be EatonEric-Lab2.
Then create a tar archive of that directory, such that the tar file
expands to the directory (not a bunch of files). Copy that tar archive
into ~eeaton/submit/cs312/lab2/ to
complete the submission.