Question: please use the c++, finish the code CS 23001 Spring 2017 Page 2 of 5 M. Decker 4. (20pts) Given the class definition below, implement
please use the c++, finish the code

CS 23001 Spring 2017 Page 2 of 5 M. Decker 4. (20pts) Given the class definition below, implement the three methods: string (const char (constructs a new string with the value of a character array), length (returns the number of characters in the string) and operator+ (returns the concatenation of two strings). You can only use the provided methods and cannot use any built in functions or libraries. The class invariant must be maintained (null terminating character array). constint CAP = 100 ; /CLASS INV: str[length () 1 == 0 class string { private: char str[CAP]; public : String () { str[0] = 0; } string (const char[1); 1'A) Need to implement int length () const ; I/B) Need to implement string operator+ (const stringE) const; /C) Need to implement
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
