Hello, i have c++ problem I will post two questions, but I only need an answer for the assert question (2nd question) pl
Posted: Tue Jul 12, 2022 8:09 am
Hello,
i have c++ problem
I will post two questions, but I only need an answer for theassert question (2nd question) please no need to answer the firstquestion, and please be honest and don't copy it.
below is the string class you are supposed to look at.
below is the assert question I need help in
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. const int CAP = 100; //CLASS INV: s[length()] = '\0', A null terminating char array class String ( public: int }; private: String char String () {s[0] = '\0'; }; (const char []); length () const; //Need to implement String operator+ (const String&) const; //Need to implement //Need to implement s [CAP]; //null terminating character array
For the string class, as given in problem 2, give a set of assertions (assert) that rigorously tests the concatenation method: String String::operator+(const String&) const;
i have c++ problem
I will post two questions, but I only need an answer for theassert question (2nd question) please no need to answer the firstquestion, and please be honest and don't copy it.
below is the string class you are supposed to look at.
below is the assert question I need help in
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. const int CAP = 100; //CLASS INV: s[length()] = '\0', A null terminating char array class String ( public: int }; private: String char String () {s[0] = '\0'; }; (const char []); length () const; //Need to implement String operator+ (const String&) const; //Need to implement //Need to implement s [CAP]; //null terminating character array
For the string class, as given in problem 2, give a set of assertions (assert) that rigorously tests the concatenation method: String String::operator+(const String&) const;