Question: Q1 Class Vec.int Q1.1 Data e We shall write a class Vec.int which simulates some functions of vectorcint>. class Vec.int ( public: l/ to do













Q1 Class Vec.int Q1.1 Data e We shall write a class Vec.int which simulates some functions of vectorcint>. class Vec.int ( public: l/ to do private int -capacity: int .8ize; intvec; . The class has three private data members. . We shall follow i a common industry practice and attach an underscore"" for the names of class data members. ta member vec is a pointer to int and is a dynamically allocated array as for vectorsint>, . The data menbers capacity and size have the sane meaning 1. The valhe of .capacity is the length of the dynamically allocated array vec 2. The value of .size is the number of elements in vec which are populated with data. 3. Obviously ecapacitylation e >_ 0 and it is our responsibility to make sure otrode always satisties this relationship. . Olviously initially capacity-o and sizem0 and vec NULL . We shall write public and private methods (inclhuding const ructors and a destructor)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
