Winter 2000

CSE 326: Mini Homework Zero
due Wednesday, April 5
Unix Warm-up Exercise

  1. 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)

  2. counter.cpp
    Makefile
  3. Compile the simple program using make and the included makefile.
  4. Use ls to check that the executable, 'hwzero' was created.
  5. Try to execute the program by typing 'hwzero'
  6. Now try to execute the program by typing './hwzero' (Why is the dot-slash necessary?)
  7. Use your favorite editor to modify the program to print its output in reverse order. Save this program as 'rcounter.cpp'.
  8. Edit 'Makefile' accordingly so that it uses rcounter.cpp to build the hwzero executable
  9. Make and run the new program to confirm that your changes worked.
  10. Edit your sample code and put in an intentional syntax error.
  11. Attempt to build the executable so you can witness the compilation errors displayed to your terminal.