title: C++: myfile.open ("example.txt") line: file not found?
body: <p>I'm learning about Input/Output with files in C++. I can compile my file, receive no error, but the file execution does not provide the result I expect.
  I have looked on internet for an answer, but could not find it.</p>
  
  <p>This is the C++ code:</p>
  
  <pre><code>// basic file operations
  #include &lt;iostream&gt;
  #include &lt;fstream&gt;
  using namespace std;
  int main () {
  ofstream myfile;
  myfile.open ("example.txt");
  myfile &lt;&lt; "Writing this to a file.\n";
  myfile.close();
  return 0;
  }
  </code></pre>
  
  <p>I have created an empty "example.txt" file in which it can write. But I believe that the algorithm does not find that file on my computer though. Is that the problem?
  Thank you for your help.</p>