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 moreHow do you read a file in C ++ program?
In order for your program to read from the file, you must:
Read more