CS 241 Data Organization using C
Lab 11: Debugging with valgrind


November 15, 2018

The purpose of lab today is to work on your debugging techniques.

1 Getting Started

Today we’re going to debug three files, example1.c, example2.c, and example3.c.

First, look visually to see what bugs that you might notice. Then, run valgrind on the compiled programs. Be sure to compile the programs with the -g flag.

You may work with a partner on this if you’d like. Have a comment at the top of your programs with who you worked with and only turn in one copy of the assignment per group.

2 To do during lab

You will receive one point per example for doing the following:

3 More time?

Continue working on homework 8 and the associated testing code. Test your code with valgrind to make sure that your code doesn’t leak any memory.

4 Turning in your program

It’s ok not to finish this assignment – get through as much as you can.

Zip up your example*.c files into a zip file entitled yourCSUsername.zip. Then drop the zip file into the dropbox under the lab-11 folder.