Build a stir type class to implement a string adt as


Build a Stir type class to implement a string ADT as described at the beginning of this section. Use a dynamic char array to store the string's characters; one of the class constructors should create this array using a capacity specified in the declaration of a Stir type object; use some default capacity for the default constructor. Implement the operations listed in the ADT description of strings. Note: When a Str; type object's lifetime is over, memory allocated for the data members will be reclaimed automatically but the array allocated dynamically by the constructor will not and a memory leak will result. To avoid this, add a destructor to your class whose name is -Stir type (), has no return type nor parameters, and that uses the delete operation to deal locate the array data member. This destructor will be called automatically whenever a Stir type object's lifetime is over. (See Section 6.3 for more information about class destructors.)

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Build a stir type class to implement a string adt as
Reference No:- TGS02584156

Now Priced at $10 (50% Discount)

Recommended (94%)

Rated (4.6/5)