Answered step by step
Verified Expert Solution
Question
00
1 Approved Answer
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 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
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started