lab8
,
and cd
to this directory.
lab8
directory. Read through the provided code to understand the existing functionality and how you should implement the interface. You are given 5 files: two interface files Pancake.h Stack.h
, two implementation files Pancake.c Stack.c
and a driver program breakfast.c
.Function definitions in Pancake.c
have already been written for you and you can use them to help you. Take your time to read through the code and understand what it's doing. Your task is to implement the functions in Stack.c
. Use breakfast.c
to call your functions and confirm that everything is working correctly. We have outlined a framework and gave some hints of what things you should test, but feel free to expand it or change completely. To compile multiple files together we issue the following commandgcc -Wall -Werror -o breakfast breakfast.c Pancake.c Stack.c
Note: Do not modify function prototypes Stack.c
or any definitions in Stack.h
. You will only submit Stack.c
which we compile with our version of breakfast.c
and default stubs.
debug.c
available here. The program reads in students ids and their mark for each course and calculates their wam. It then display how many people failed and who has the highest wam. Most of the errors can be fixed by reading through compile errors but there are a couple algorithmic errors as well. This link provides great information about compile errors. You can compile with
gcc -Wall -Werror -o debug debug.c 2> errors.txtto redirect error output to a file. You need to show your working program to your tutor to get marked off. Credit goes to Alex Linker for this amazing challenge.
$ give cs1917 lab8 Stack.c