title: Opening a file in C++ outside of the working directory
body: <p>I've got a program that is going to have several resource files that the user can put somewhere on the computer that isn't in the same folder as the executable. How do I get open those files?</p>
  
  <p>I've found lots of answers saying that the reason things aren't working is that the file isn't in the working directory. I've tried providing fully qualified paths:</p>
  
  <pre><code>ifstream str;
  str.open("/home/millere/foo.txt")
  </code></pre>
  
  <p>but that was unsuccessful. I know the path was correct (copy and paste). I can't find any documentation on it, but I assume it has to be possible. (<code>vim ~/foo.txt</code> from anywhere other than <code>~</code> works, for example).</p>