4.2: Input/Output with Files
Watch the first video to explore reading input from a file and to see how you can move from simple keyboard input that we have done thus far to inputting from a file. The second video teaches how to store your output into a file rather than the screen.
Though these videos refer to Java, the same principles apply to C++.
Read this article and complete the exercises at the end to test your skills in inputting from and outputting to files.