title: C++: Where does the ofstream class save the files to?
body: <p>I moved from Windows to Mac and now I'm experiencing a problem with the file input/output classes: <code>ifstream</code> &amp; <code>ofstream</code>.</p>
  
  <p>In Windows when you run with g++/Code Blocks</p>
  
  <pre><code>ofstream out("output.txt");
  out &lt;&lt; "TEST";
  out.close();
  </code></pre>
  
  <p>A new file "output.txt" will be created in <strong>the same</strong> directory. </p>
  
  <p>However in MAC OS X, this file is created in my home directory: /Users/USER_NAME/output.txt</p>
  
  <p>How can I have this file in the same directory together with the executable?</p>
  
  <p>P.S. I'm using GCC and CodeBlocks. There are no projects - I'm just compiling a single source file.</p>