When using
where does the text.txt file have to be located in order for it to be read?Code:ifstream a_file("text.txt");
Printable View
When using
where does the text.txt file have to be located in order for it to be read?Code:ifstream a_file("text.txt");
Directory of which the program is.
>Directory of which the program is.
I always thought it was the directory from which you are running the program.
It is the current working directory, which might be the directory the exe resides in, or it might be the directory from which you run the program, or it might be neither.
What element determines working directory? (in Windows) And how can we change it in our program? Is there any API function?
>>Is there any API function?<<
SetCurrentDirectory and GetCurrentDirectory.
Why there is no <cdirect>?
direct.h is not a standard C header, so it doesn't get updated to cdirect by the standard C++ library.
So what is it?
it stays <direct.h>
that's if your compiler has it