Lab Assignment--Compile and Debug

Part 1-Makefile

Write a Makefile for the oneline program from last/this week's lab.

Part 2-Memory Leak

If you submitted code with a memory leak, here is your opportunity to fix your code.

valgrind --leak-check=yes yourexecutable

Should produce a message that says no memory leaks and no errors.

Note:If you have hardcoded sizes for your cstrings or array of words, then you will lose marks in this week's submission. For instance:
words=new words[200]; //do NOT write numbers like 200 when allocating--dynamic allocation means that it will change each run

Part 3-Debugging

  1. Capture a script of you running the debugger on the command-line:


Submit 6 files to URCourses

  1. your Makefile
  2. script of the Makefile working with the clean and valgrind target (make sure the valgrind produces no errors or memory leaks)
  3. oneLine.cpp
  4. oneLine.h
  5. main.cpp
  6. script of gdb