unfamiliar with using files c++

I am working on an assignment and was wanting to know if one of u guys could let me know if I have 1. correct before I go to 2.

Here are the instructions...

1. read in the data then displayed the data.
2 Add the following
a. add a data structure to hold the data
b. read in the data from the input file
c. store the data in the data structure
d. write the data to a output file!

Part 1 works fine. I was thinking that you could simplify your code in the long run by reading everything into your data structure and then from there you can use a single loop to to display the contents to the screen and output it to a file. Otherwise you'll have to read the file again so that you can put the data into the data structure, which seems like unnecessary work if you ask me.