The filename parameter is actually the full path. If you don't specifiy a full path it uses the current directory.
Also note: _wfopen is for wide strings, which you don't appear to be using, and it only takes 2 parameters, not 3:
1 2 3 4 5
FILE* yourfile = _wfopen( L"C:\\Programs File\\Success\\expt\\happy.rff", L"r");
if(!yourfile)
{
// file failed to open
}
Notice that wide strings are prefixed with the L character.
Also note that _wfopen is MS specific and is not portable. Since you don't appear to need wide character strings, you could probably just use fopen, which is a standard function and is therefore portable:
fopen is the ANSI C standard function for opening a file.
_wfopen is the Windows equivalent that supports wide string. Wide strings are native on the WIN32 API. char strings are converted to/from during use. So this is a WIN32 specific function.
fopen_s is the "safe" version of fopen, introduced by Microsoft in Visual Studio 2005. It's a WIN32 specific function.
_wfopen_s is the "safe" version of _wfopen, introduced by Microsoft in Visual Studio 2005. It's a WIN32 specific function.