Only edit empty lines of a file

I'm trying to make a program format a really large html file, so that it isn't displayed as a huge chunk of text. I want to put <br> in the empty lines of the html file. Right now, every other line of the file is blank. How would I do this? Here's the basic structure of the code. Not sure if it's good or not.

Inside main:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
int endloop = 0; //This will stop the future loop.

fstream myfile ("C:\\location\\file.html");

while(endloop == 0){
if(!myfile.eof()){
if(/*Line is empty*/){
cout << "<br>";
}//End of line is empty
else //Skip to next line.
}//End of !myfile.eof
else endloop + 1;
cout << "Done.";
}
return0;


Or is telling it to put <br> into every other line easier?
Topic archived. No new replies allowed.