Question: 6. Consider the following prototype: function foo (const intp)i What restriction does the const keyword provide within the implementation of foo? (5 points) 7. Consider

 6. Consider the following prototype: function foo (const intp)i What restriction

6. Consider the following prototype: function foo (const intp)i What restriction does the const keyword provide within the implementation of foo? (5 points) 7. Consider the bag from Chapter 4 (using a dynamie array). The pointer to the dynamic array is called data, and the size of the dynamic array is stored in a private member variable called capacity. Write the following new member function: void bag::triple capacity / Postcondition: The capacity of the bag's dynamic array has been tripled. The bag still contains the same items that it previously had Do not use the reserve function, and do not cause a memory leak. Do make sure that both data and capacity have new values that correctly indicate the new larger array (10 points)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!