title: C++ fopen relative Path
body: <p>I read through some topic about relative path, but i still got i wrong.
  I hope sb can help me :).
  I am using Visual studio 2013, windows 7</p>
  
  <p>I got the following directories:</p>
  
  <p>Here is my .exe file
  D:\uni\c++\ex5\msvc2013\ex5\Debug</p>
  
  <p>Here is the file i want to read
  D:\uni\c++\ex5\res\thehead.raw</p>
  
  <p>The code for opening the file:</p>
  
  <pre><code>FILE* f;
  f = fopen("..\\..\\..\\res\\thehead.raw", "rb");
  if (f == NULL)
  printf("FAIL!!");
  </code></pre>
  
  <p>As i need to use relative paths i figured it out as following:
  ..\ gets to parent directory.</p>
  
  <p>so "..\..\..\" should get me into the folder "D:\uni\c++\ex5\".</p>
  
  <p>\res should open the res foulder.</p>
  
  <p>Needless to say it fails and i have no idea why.
  Any help would be appreciated.</p>