fstream file("afile.txt" , ios :: out | ios:: in | ios :: app);
if(!file.is_open())
{
cout << "Error Loading File!";
}
else
{
// cout << " File Created ";
}
for(i = 0 ; i < gameplayed ; i ++)
{
file <<name << " Won $" << prize << " And Answered " << questions << " Questions" << "\n";
}
file.seekg(0);
string line;
while(file.good())
{
getline(file,line);
cout << line ;
}
So basically the codes works perfectly and doesn't overwrite, but it just starts right after like
"Player Won $2000 Dollars And Answered 6 Questions Plater2 Won $2000 Dollars And Answered 6 Questions"
I want is To Appear Like With a line break and not after it