Comp 345
Assignment 3
Topic: Strings Part 1
Points: 25


  1. Review use of pointers
  2. Review dynamic memory
  3. Make good use of encapsulation and information hiding


  1. Start with these files:

  2. Implement the functions that are commented out in the header file.
  3. Be sure to check for NULL pointers in every possible scenario.
  4. Make sure your test program thoroughly tests your string class.


When writing your insert functions:
When the index to insert into the string is < 0 use the prepend functionality of your class.
When the index to insert into the string is > the length of pString use the append functionality of your class.


You should only have to implement the logic of your functions in one place per function type. For example you should only have to write the append functionality once. Use that function from all of your other functions. I recommend placing your logic in the functions that take the char*. It is ease to create one of those and call it from the others.


Files to Submit