Solve this question using C++. ECE218 Fall 2018 Part # 1: Your Mstring class (60
ID: 3744780 • Letter: S
Question
Solve this question using C++.
ECE218 Fall 2018 Part # 1: Your Mstring class (60) 1. Your class represents a string using an internal vector. You are not allowed to use the built-in C++ string class for any part of this implementation. Every occurrence ofa C++ string in the implementation will result in loss of points. The class, Mstring, contains at least private members (you may add others as you need) 2. char *str; // the vector b. a. int length; // length of the internal string 3. It also has at minimum (you can add additional methods as you need) a. Mstring); // Default Constructor b. ~Mstring0; // Destructor c. void setString(char *s, int len); i. Copy the string pointed to by s to the internal str, destroy the internal str if it exists d. void setString(Mstring &s); i. Copy the string referenced by s to the internal str, destroy the e. char *getStringO f char charAt(int loc); g. void toUpperO h. void toLower) i. int compareTolgnoreCase(Mstring &s) internal str if it exists i. Get a copy of the internal stir i. Return the character at location loc i. Convert all chars of the internal string to uppercase i. Convert all chars of the internal string to lowercase i. Compare the string referenced to by s to the internal str 1. 2. 3. Return -1 if the internal str is less than the string referenced to by s Return 0 if the internal str is equal to the string referenced to by s Return 1 if the internal str greater then than the string referenced to by s j. ostream &print(ostream &out); i. Print the string on the stream referenced to by out