Despite entering 'y' the code isn't accepting more input. This much part is not yielding the required result.
Code block:
char ch='y';
of.open("FileHandling.txt", ios::app); //opening file.
while(ch=='y')
{
cout<<"\n\n\t\tEnter contents in the file : \n\n\t\t";
getline(cin, content);
of<<content;
cout<<"\n\n\t\tWish to write more ( y / n ) ? : ";
cin>>ch;
}
of.close(); //closing file.
Program should take in input as per the wish of user which is not being done. Then it should display the contents of the file. It is displaying the contents.