CPE 101: Fundamentals of Computer Science I
Lab 4 materials

Instructor's test program execuatable

Decision functions tests

Working with object (.o) files

print-all.o is a so called C object file. It is the result of partial compilation of the instructor's print-all.c program. The printall executable is print-all.c compiled together with the instructor's version of all Lab 4 functions.

print-all.o was compiled without adding grove.c code. Thus, it is not a complete executable. But you can compile it together with your grove.c file to create an executable that will print all your code. The compilation command is

$ gcc -ansi -Wall -Werror -lm -o myPrintall print-all.o grove.c

To compare the results of your work to the instructor's results you can do this:

$ chmod u+x printall
$ ./printall > alex-output
$ ./myPrintall > my-output
$ diff my-output alex-output
If the last command produces NO visible output, your code produces exactly the same output as the instructor's code.
October 12, 2013, dekhtyar at calpoly.edu