title: compile error: ifstream::open only accepts string values in quotes "" and not string variables
body: <p>Does <code>open</code> function have some sort of restriction as to what kind of string value is passed in?</p>
  
  <pre><code>ifstream file;
  string filename = "output.txt";
  file.open(filename);
  </code></pre>
  
  <p>I tried to pass a string value with a string variable, but when it tries to compile, the result is...</p>
  
  <pre><code>agent.cpp:2:20: error: ofstream: No such file or directory
  agent.cpp: In function ‘std::string readingline(std::string)’:
  agent.cpp:11: error: aggregate ‘std::ifstream file’ has incomplete type and cannot be     defined
  agent.cpp: In function ‘int main()’:
  agent.cpp:44: error: aggregate ‘std::ofstream writefile’ has incomplete type and cannot be defined
  </code></pre>
  
  <p>On the other hand, when I just pass a string value in quotes like "filename.txt" , it compile fine and runs fine.</p>
  
  <pre><code>ifstream file;
  file.open("output.txt");
  </code></pre>
  
  <p>Why is this the case?</p>
  
  <p>Is there a way to solve this problem?</p>