Your Task

You must write a String class that performs some range checking and efficient determination of length, and that provides some other basic String functionality.

Create a directory and download the following files:

    mystring.h
    mystring.cpp
    main.cpp

You will have to fill in some parts in the class String implementation file mystring.cpp.
These parts are specified in the source code by // Fill in here comment.

In your implementation of String methods, use the library functions provided by string.h, which operate on arrays of characters terminated by NULL (\0).

The compile command you should use is:
g++ -c mystring.cpp 
g++ -c main.cpp 
to compile separately the source files mystring.cpp and main.cpp into object files, and
g++ -o main main.o mystring.o 
to link the object files main.o and mystring.o, and create an executable named main.

This page created by Jonathan Alon <jalon@cs.bu.edu>.