Exercise 01 - C Compilation
Out: Monday January 8, 2018
Due: Wednesday January 10, 2018 by 11:15am.
- Fetch the source files, main.c, sub.h,
sub.c, and makefile (or just the
file ex01.tar.gz).
- Build an executable from the source code using the makefile. (Just say 'make'.)
Note that it builds without error.
- Run the executable you just created: ./ex01
Note that it gets what seems to be a wrong answer (2 to the power 4 isn't 1).
- Figure out why.
- Hand in to the course dropbox a pdf file listing your name and
- a brief (one or two sentence, say) description of what the problem was
- explain how you could fix the executable by modifying only sub.h
- explain how you could fix t he executable by modifying only sub.c
- explain how you could get the compiler to complain that something is wrong
by modifying only sub.c
- can you fix the problem by modifying only main.c? Briefly explain.
- Don't hand in any code.