path to executable
-
I am programming in c and would like to know how I can find the location of my executable programatically. So if the executable is moved to a new location my program will know its current path. Thanks, SAK
-
I am programming in c and would like to know how I can find the location of my executable programatically. So if the executable is moved to a new location my program will know its current path. Thanks, SAK
To parapahrase "If all else fails read the FAQ" http://www.codeproject.com/cpp/cppforumfaq.asp[^]
If I have seen further it is by standing on the shoulders of Giants. - Isaac Newton 1676
-
To parapahrase "If all else fails read the FAQ" http://www.codeproject.com/cpp/cppforumfaq.asp[^]
If I have seen further it is by standing on the shoulders of Giants. - Isaac Newton 1676
-
I am programming in c and would like to know how I can find the location of my executable programatically. So if the executable is moved to a new location my program will know its current path. Thanks, SAK
If you are just writing a simple console app, you can use argv[0]. --Dean
-
If you are just writing a simple console app, you can use argv[0]. --Dean
-
Except -- argv[0] does not return a fully-qualified path name if the .EXE is run from the same directory (from the current directory).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Peter Weyzen Staff Engineer Santa Cruz Networks