Question: In C++ format, Working with char vector using Array A class CharVectArray has been declared and needs to be implemented using an array of type


In C++ format, Working with char vector using Array A class CharVectArray has been declared and needs to be implemented using an array of type char to set its elements. First, complete the class by finishing the code for the default and copy constructors, the assignment operator and the destructor. Then use the main function to test it. #include iostream using namespace std; #define MAXSIZE 26 class CharVectArray { public: CharvectArray(int vsize = MAXSIZE); // default constructor CharVectArray (char vlist[], int arraysize); // constructor with init parameters CharVectArray(const CharVectArray& fva); // copy constructor CharVectArray& operator = (const CharVectArray& fva); // assignment operator CharVectArray);// destructor void printElements (); 1/ prints all elements in the vector private: char *vector; int vectorsize, // the vector // size of the vector // default constructor CharVectArray::CharVectArray (int vsize) // to be completed // constructor with initialization parameters CharVectArray::CharVectArray (char vlist[], int arraysize) { // to be completed // copy constructor CharVectArray::CharVectArray (const CharVectArray& fva) // to be completed // assignment operator CharVectArray& CharVectArray: : operator = (const CharVectArray &fva) { // to be completed // destructor CharVectArray:~CharVectArray() [ // to be completed ) void CharVectArray: :printElements() [ // to be completed )
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
