C++ detecting end of file
<p>I have a C++ program that is reading in info from a file, that stores info seperated by "$$$$". An example of how the file looks is:</p>

<p><code>
abc<br>
bcd<br>
$$$$<br>
def<br>
$$$$<br>
qwe<br>
gfh<br>
$$$$
</code></p>

<p>How can I detect the file has ended, without using the eof() function?</p>

<p>I have it set like this,</p>

<p><code>getline(sin,temp)<br>
if (temp=="$$$$")<br>
{<br>
}</code></p>

<p>After reading the last set of four dollars, how can I check the next line to ensure another set of data isn't beginning, and that the file has ended? If the file has indeed ended, I plan on using a boolean flag to terminate the while loop.</p>
