how to reference the executable directory
Posted on 1998-01-06
I have this program, sitting on Netware k:\abc\. When it runs, it needs to read in a file from the directory where the execuatable resides (so k:\abc\).
When a LAN user execute this program from their desk top, at c:\, they type -
How does theExe know to search the executable's directory instead of user's c:\? I know the following will NOT work -
FILE* = fopen("file.txt", "r"); //this look into the current working directory of the user - c:\
I know I can specify the \\server\path in my program. Is there any other ways?