title: New to Xcode can't open files in c++?
body: <p>I've been using windows in a class I've been taking but I am trying to run a basic code to figure out how to open/close/input/output from files on Xcode and the code I usually use on visual studios isn't working any idea why? thanks!</p>
  
  <pre><code>#include &lt;string&gt;
  #include &lt;iostream&gt;
  #include &lt;fstream&gt;
  using namespace std;
  
  int main()
  {
      ifstream fin;
      ofstream fout;
      string input;
  
      fin.open("inputFile.txt");
      if(fin.fail())
          cout &lt;&lt; "File failed to open." &lt;&lt; endl;
      fin &gt;&gt; input;
  
      fout.open("outputFile.txt");
  
      fout &lt;&lt; input;
  
  
  }
  </code></pre>