Homework 2


80 pts., due Mar. 8

  1. Write a complete string class, using a linked list representation (one character per list item). Implement the class so that you can determine the length of a string without traversing the list and counting. Include the following public methods:

    With the exception of strzero and strprt, these string operations are described in any C/C++ book. You should adapt the formal parameters and return values to work better with the class. For instance, no function should return a pointer; it makes more sense to return an integer position.

    You may borrow any code you wish from Carrano. You may find the code in the directory tree rooted at keystone:~kelliher/pub/cs23/carrano.

    Write a program which demonstrates that your class is working. You should submit the following:

It is not acceptable to throw all your source code into one file, nor is it acceptable to use a source code file as the argument to a #include preprocessor directive.

Thomas P. Kelliher
Thu Feb 22 22:29:10 EST 1996
Tom Kelliher