Goals for this Warmup

  • Practice programming with pointers (input and output function parameters).
  • Practice programming with strings.
  • Practice programming with 2-d arrays (images).

For this lab, you are welcome to get technical help from another student on how to use or install any of the tools involved. You may also get syntax help on C. You may not, however, get help on the algorithmic portion of the exercise outside of your partner, office hours, piazza questions to TAs or instructors.

This lab is broken down into several steps:

Set up

You should have already created a hw4 directory and completed the pre-lab. This means everyone has a set of skeleton files that compile.

Exercises

Make sure you add everything to the compile line of your Makefile. Remember that you need the png library (and the -lpng flag on your compile line) in order to compile!

Inspect the main file - it has a single call to each function. It also shows how to write the results of your image arrays into an image. This is why I provided the functions for you to do so.

Now get to work on those warmup functions! When you finish, move on to the homework.

Submit

At this point, you should have done the following:
  • Checked out your repository
  • Created a folder named hw4 in your repository and run svn add hw4
  • Created several files and filled in the proper information: warmup4.h, warmup4.c, warmup4_main.c, hw4_provided.h, hw4_provided.c, and Makefile inside your hw4 directory.
  • Added all of the new files to your repository using svn add.
  • Compiled your executable manually and with the Makefile
  • Run your code to make sure it runs properly and inspected the results.
  • Committed your code: $ svn commit -m "hw4 warmup complete"
Now you're ready to move on to hw4!! Remember that the homework is completed individually. If you finish before lab ends, you are expected to move on to the homework, not leave early.