|The online notes contain a partial definition of a "home-made" String class. Your assignment is to take this definition and do the following:
- Fix any errors in the current definition.
- Ensure that definitions exist for a length() member, a default constructor, a copy constructor and an assignment operator.
- Add a class member concat(S) that concatenates the string S to the current string.
- Overload the '+' operator to return a reference to the result of the concatenation of its two arguments.
- Overload the '-' operator so that the expression
(Str1 - Str2 )
returns a reference to the String that results from deleting the first occurence of Str2 in Str1.
- Your solution should allow the programmer to use expressions such as
Str1 += "this is a string";
Str2 -= "this";
Str2 = Str3 - Str2;
Str3 = "This is a string" + Str2;
- Minimize use of "friends".
1. All the code should be in a single file called (Hm_Md_String.cpp)
2. Code must be functioning correctly according to the requirements.
You must fix any errors in current definition.
No missing required functions and overloaded operators.
3. Well handled null pointer cases.
4. Perfectly clear internal documentation.
5. Brief external documentation
6. Thorough testing.
7. A bonus may be granted for exellent programming style.
Please make sure to submit your assignment before the deadline.
Graders will not grade your late assignment.