I've written a program that writes into a text file and reads from the same file. When I run it and put the required content of the file, I don't know how to terminate it so that it stops writing into the file and does the next step that reads and displays.
Can anyone please help me?
Here is my code:
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
char ch;
ofstream fout("SnrLecturers.txt",ios::app);
I've tried that, I pressed Ctrl-Z and ^Z appears, then I pressed enter and the program terminated and does not go through the code where I read from the file. I am using Code Blocks.