Winter 2000
CSE 326: Mini Homework Zero
due Wednesday, April 5
Unix Warm-up Exercise
- Download the following two files to your home directory on a unix machine:
(note: if you are using netscape you may need to right-click on the links below to save them)
counter.cpp
Makefile
- Compile the simple program using make and the included makefile.
- Use ls to check that the executable, 'hwzero' was created.
- Try to execute the program by typing 'hwzero'
- Now try to execute the program by typing './hwzero' (Why is the dot-slash necessary?)
- Use your favorite editor to modify the program to print its output in reverse order. Save this program as 'rcounter.cpp'.
- Edit 'Makefile' accordingly so that it uses rcounter.cpp to build the hwzero executable
- Make and run the new program to confirm that your changes worked.
- Edit your sample code and put in an intentional syntax error.
- Attempt to build the executable so you can witness the compilation errors displayed to your terminal.