title: ifstream::open not working in Visual Studio debug mode
body: <p>I've been all over the ifstream questions here on SO and I'm still having trouble reading a simple text file.  I'm working with Visual Studio 2008.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>// CPPFileIO.cpp : Defines the entry point for the console application.
  //
  
  #include "stdafx.h"
  #include &lt;fstream&gt;
  #include &lt;conio.h&gt;
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  
  int _tmain(int argc, _TCHAR* argv[])
  {
  
      ifstream infile;
      infile.open("input.txt", ifstream::in);
  
      if (infile.is_open())
      {
          while (infile.good())
              cout &lt;&lt; (char) infile.get();
      }
      else
      {
          cout &lt;&lt; "Unable to open file.";
      }
      infile.close();
      _getch();
      return 0;
  }
  </code></pre>
  
  <p>I have confirmed that the <em>input.txt</em> file is in the correct "working directory" by checking the value of <code>argv[0]</code>.  The Open method just won't work.</p>
  
  <p>I'm also having trouble debugging- should I not be able to set a watch on <code>infile.good()</code> or <code>infile.is_open()</code>?  I keep getting </p>
  
  <pre><code>Error: member function not present.
  </code></pre>
  
  <p><strong>EDIT:</strong> Updated code listing with full code from .CPP file.</p>
  
  <p><strong>UPDATE:</strong> The file was NOT in the Current Working Directory.  This is the directory where the <em>project file</em> is located.  Moved it there and it works when debugging in VS.NET.</p>