CISC220, Summer 2006, Project 3

Introduction

This is a small project on pointers

In this project, you will implement strtokWithQuotedStrings. You were provided this function for project 2, but only in .o form. See that project, and the lectures leading up to it for more explanation about this function. If anything is not clear, ask questions!

To implement strtokWithQuotedStrings, you will need to understand static variables in C++ functions. An example of how these work is provided to you, namely an implementation of "regular" strtok called myStrtok.

What to do

  1. Get the code from the directory proj3. In this directory, you'll find test code for myStrTok. Your first job is to write a Makefile to compile myStrTok.cc and myStrTokTest.cc and link them together into an executable called myStrTokTest. Run that executable, and you should find that all the tests pass. Include a "make clean" rule, and enough code so that when you do "make all", you both compile AND RUN the test code for myStrTok.
  2. Now, edit the Makefile so that you also compile, link and run an executable called strtokWithQuotedStringsTest. Run this program, and you'll see that the first test fails, and then the program seg faults.
  3. Now, edit strtokWithQuotedStrings.cc to replace that function with one that works properly and passes all the tests. When you are finished, script your work (include listings of your Makefile, strtokWithQuotedStrings.cc, and any other file that you modified from the original, as well as a clean compile and run.)

Grading:

 

End of file proj3.html, for Project 3, CISC220, 06J