Cannot read text file in C++
<p>I am stumped by this simple problem. I am reading a text file with C++: </p>

<pre><code>std::ifstream stream; 
stream.open(filename); 
if (!stream) 
   cout &lt;&lt; "Invalid stream" &lt;&lt; endl; 
</code></pre>

<p>And <code>!stream</code> is true but there seems to be nothing wrong with the text file. Under what circumstances can <code>stream</code> be false? </p>

<p><strong>Note:</strong> is_open returns true </p>
