title: opening a file based on user input c++
body: <p>I am trying to make a program that would open a file based on the users input.
  Here`s my code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;string&gt;
  using namespace std;
  
  int main() {
  
      string filename;
      ifstream fileC;
  
      cout&lt;&lt;"which file do you want to open?";
      cin&gt;&gt;filename;
  
      fileC.open(filename);
      fileC&lt;&lt;"lalala";
      fileC.close;
  
      return 0;
  }
  </code></pre>
  
  <p>But when I compile it, it gives me this error:</p>
  
  <pre><code>[Error] no match for 'operator&lt;&lt;' (operand types are 'std::ifstream {aka std::basic_ifstream&lt;char&gt;}' and 'const char [7]')
  </code></pre>
  
  <p>Does anyone know how to solve this?
  Thank you...</p>