Skip to content

CS 1415 - Lab #6

Objective: 

Develop your own String class

Preparation: 

Review chapters 10 and 13 fom Starting Out with C++ by Gaddis.

Programming: 

  1. Name your files LlllFfffLab06.cpp, LlllFfffString.cpp, and LlllFfffString.h where Llll is the first four letters of your last name and Ffff is the first four letters of your first name.
  2. Create your own String class to represent a string as though the C++ string class didn't exist.. The class should use dynamically allocated memory to store the actual string data. Provide for both a default constructor and an explicit value constructor that recieves a c-string for the intial value. Also, provide a destructor to deallocate the memory used. Provide a set member function to "assign" a new string value to the object, a member function to print the string, and a member function to return the size of the string. All string parameters needed by these member functions should be c-strings.
  3. Write a driver program to demonstrate the your String class. The driver should demonstrate all specified features of the class. Be sure to modularize.
  4. Verify your program works correctly.
  5. Submit your source code file to ude.wons@nosneros.htrag. Due at 8:00 am on 11 February.