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
I got the following directories:
Here is my .exe file D:\uni\c++\ex5\msvc2013\ex5\Debug
Here is the file i want to read D:\uni\c++\ex5\res\thehead.raw
The code for opening the file:
FILE* f;
f = fopen("..\\..\\..\\res\\thehead.raw", "rb");
if (f == NULL)
printf("FAIL!!");
As i need to use relative paths i figured it out as following: ..\ gets to parent directory.
so "..\..\..\" should get me into the folder "D:\uni\c++\ex5\".
\res should open the res foulder.
Needless to say it fails and i have no idea why. Any help would be appreciated.