Solution Found!
Exercise P7.14 demonstrated how to use the string and vector classes to
Chapter 7, Problem P7.15(choose chapter or problem)
Exercise P7.14 demonstrated how to use the string and vector classes to implementresizable arrays. In this exercise, you should implement that capability manually.Allocate a buffer of 1,000 characters from the heap (new char[1000]). Whenever thebuffer fills up, allocate a buffer of twice the size, copy the buffer contents, and deletethe old buffer. Do the same for the array of char* point ersstart with a new char*[100]and keep doubling the size.
Questions & Answers
QUESTION:
Exercise P7.14 demonstrated how to use the string and vector classes to implementresizable arrays. In this exercise, you should implement that capability manually.Allocate a buffer of 1,000 characters from the heap (new char[1000]). Whenever thebuffer fills up, allocate a buffer of twice the size, copy the buffer contents, and deletethe old buffer. Do the same for the array of char* point ersstart with a new char*[100]and keep doubling the size.
ANSWER:Step 1 of 6
#include<iostream>
#include<string>
#include <sstream>
#include <fstream>
using namespace std;