In order for your program to read from the file, you must:
Read moreHow do you create a file handling in C++?
To create a file, use either the ofstream or fstream class, and specify the name of the file . To write to the file, use the insertion operator ( << ).
Read more