Hi,
I wish to delete the first 3 lines from a file. Following is my code which goes into an infifnte loop.
int main()
{
vector<string> text_file;
fstream fout;
int count = 1;
fout.open("tempfile.txt");
assert(!fout.fail());
string temp;
while(!fout.eof())
{
if(count <= 3)
{
getline(fout,temp);
count++;
}
if(count > 3)
{
getline(fout,temp);
fout << temp << "\n";
}
}
assert(!fout.fail());
fout.close();
/* End of writing to a file */
return 0;
}
Please help.