Question: Need help with a c++ program please help I've tried I'll post what is asking from the book and with the pages code that was
Need help with a c++ program please help I've tried I'll post what is asking from the book and with the pages
code that was given
// StringDriver.h #ifndef _STRINGDRIVER_H #define _STRINGDRIVER_H #include "String.h" #include "ReverseString.h" #include "CaseString.h" int main(); void test1(); void test2(); void test3(); void test4(); void test5(); void test6(); void test7(); void test8(); void test9(); void test10(); void test11(); void test12(); void test13(); void test14(); void test15(); void test16(); void test17(); void test18(); void test19(); void test20(); void wait(); #endif ------------------------------------------------------------------------------------------------------------------------- // StringDriver.cpp #include #include #include #include "StringDriver.h" using namespace std; ofstream csis; int main() { csis.open("csis.txt"); test1(); test2(); test3(); test4(); test5(); test6(); test7(); test8(); test9(); test10(); test11(); test12(); test13(); test14(); test15(); test16(); test17(); test18(); test19(); test20(); csis.close(); } void test1() { cout " t13 ? "True" : "False") = " = t13 ? "True" : "False") " t13 ? "True" : "False") = " = t13 ? "True" : "False") that Inheritance Lab (String Class) One of the strin cons nd most popular classes to define in C++ is the one that emulates a ng literal in C. The reason is that a string is not a built-in type in C, and yet it is must call upon functions in the library copy, duplicate, compare, etc. In C++, this need is obviated by the use of all the time. Thus, to perform the various manipulations on strings, you string.h that perform operations such as function object, you will use two data members: and operator overloading. In order to represent the state of a String it mi the length, length, of the string as an int e a pointer, buf, to the string literal of type char (c ing This im NULL C A point array so that memory can be allocated at run-time (via the operator new) therefore, have no restrictions placed upon the length of the string (too big or too small). The length field is not strictly mandatory since it can always be obtained from the string pointer via the strlen) function. However, it's probably a good idea to have it to avoid repeated calls to strlen() ter to a character (char ) is used instead of a fixed-length character Overloaded Constructor Functions Rec supp The creation of each String instance involves allocation of space on the heap, copying the string literal, and setting the length data member accordingly. Because there are many different ways in which a String object can be initialized, the constructor functions for the String class must be overloaded to accommodate all of the various situations. me not yo on First, if a string object is created with no explicit initialization, then the default constructor (the one that can be called with no actual arguments) will be called. It makes sense that we should have the invoking instance point to an empty string literal whose length is zero. string) Focus on Object-Oriented Programming with C++ Page 358