title: Writing to .csv file in C++
body: <p>I'm trying to output data to a <code>.csv</code> file, but when I run the program it does not change the output file. It is as if I have not run the program at all. It builds successfully.</p>
  
  <p>I created this project in XCode. The <code>".xcodeproject"</code> and <code>"example.csv"</code> files are located in the working directory (<strong>Desktop</strong> -> <strong>ofstream</strong>). <code>"main.cpp"</code> is located in <strong>Desktop</strong> -> <strong>ofstream</strong> -> <strong>ofstream</strong> and is the only file in that folder. I am using "Release" for builds.</p>
  
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  
  int main( int argc, char* argv[] )
  {
      std::ofstream myfile;
      myfile.open ("example.csv");
      myfile &lt;&lt; "This is the first cell in the first column.\n";
      myfile &lt;&lt; "a,b,c,\n";
      myfile &lt;&lt; "c,s,v,\n";
      myfile &lt;&lt; "1,2,3.456\n";
      myfile &lt;&lt; "semi;colon";
      myfile.close();
      return 0;
  }
  </code></pre>
  
  <p>What am I missing to successfully write into this <code>.csv</code> file?</p>