title: Cannot open file in Xcode 3
body: <p>I can't get files in Xcode to be read. I've tried everything from putting them in the source, documentation and products folders and putting the file in the same folder as the source code. The code is as follows:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  using namespace std;
  
  int main()
  {
      string line;
      ifstream infile;
      infile.open ("example1.txt");
      getline (infile,line);
      cout &lt;&lt; line &lt;&lt; endl;
      if (infile.is_open())
          cout &lt;&lt; "file opened successfully\n";
      infile.close();
  }
  </code></pre>
  
  <p>And nothing is printed in the output. Any suggestions are greatly appreciated. </p>