title: How do I write a string to a .csv file?
body: <p>I currently have this code, but I would like to be able to output to a .csv file, rather than just print to screen. Does anyone know how to do this?</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;algorithm&gt;
  
  using namespace std;
  
  string Weather_test;
  
  int main()
  {
      ifstream Weather_test_input;
      Weather_test_input.open("/Users/MyName/Desktop/Weather_test.csv");
  
      getline(Weather_test_input, Weather_test, '?');
  
      Weather_test.erase(remove_if(Weather_test.begin(), Weather_test.end(), ::isalpha), Weather_test.end());
  
      cout &lt;&lt; Weather_test;
  
      return 0;
  }
  </code></pre>