Goals for this Warmup

  • Practice programming with strings.
  • Practice programming with structs.
  • Practice dynamically allocating (and reallocating) memory.

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 hw5 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!

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 hw5 in your repository and run svn add hw5
  • Created several files and filled in the proper information: warmup5.h, warmup5.c, warmup5_main.c, warmup5_provided.h, warmup5_provided.c, and Makefile inside your hw5 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 "hw5 warmup complete"
Now you're ready to move on to hw5!! 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.