Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Data: we wish to allow our String class to accommodate strings of different size

ID: 3539244 • Letter: D

Question

Data: we wish to allow our String class to accommodate strings of different sizes. To that end, instead of storing a string's characters in a fixed-size array, each String object should contain the following data as part of its internal representation:

(1) a character pointer meant to point to a dynamically-allocated array of characters.
(2) a length field that will hold the current length of the string at any given moment.

Operations: same as the methods in String class - phase 2, plus the destructor, copy constructor, and assignment operator overloading.

Tell me your email address, and I send you file.

Explanation / Answer

hanny.gupta@gmail.com