Infinite loop while reading stdio.h
<p>why does the following program gets stuck in an infinite loop??</p>

<pre><code>int main()
{
    string fname = "C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\include\\stdio.h";
    char line[985];

    ifstream file(fname.c_str());

    if(file == NULL)
    {
        cout&lt;&lt;"unable to open";
        exit(0);
    }

    while(!file.eof())
    {
        file.getline(line,'\n');
        cout&lt;&lt;line&lt;&lt;'\n';
    }
}
</code></pre>
