Question: Write a C++ program that performs the following steps. 1. Read this file one time to determine how many records it contains. Be sure to
Write a C++ program that performs the following steps.
1. Read this file one time to determine how many records it contains. Be sure to check for a successful file open here.
2. Close the file.
3. Allocate memory dynamically to store the data from step 1. This dynamically allocated memory should be for an array of strings.
4. Reopen the file and read it a second time, storing each record into the array of strings from step 3.
5. Print the first and last record in the array.
6. Release the allocated memory.
7. Your program output should look like this:
Date Open High Low Close Volume Adj Close* Oct 16, 2015 64.26 64.26 64.26 64.26 0 60.18
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
