title: Create a vector of ofstreams
body: <p>I'm trying to create a vector of ofstreams..</p>
  
  <pre><code>vector&lt;ofstream&gt; streams;
  for (int i = 0; i &lt; numStreams; i++){
    ofstream out;
    string fileName = "text" + to_string(i) + ".txt";
    output.open(fileName.c_str());
    streams.push_back(out);
  }
  </code></pre>
  
  <p>This code will not compile.. specifically the last line where I attempt to add the ofstream to my vector is generating an error. What am I overlooking?</p>