I know it can be done using OS specific code, or Boost, but I can't see a way to do it using the standard library filesystem. Note that current_path wouldn't work as the executable might be called from a different directory.
Asked
Active
Viewed 1,041 times
2
-
Possible duplicate of [Get path of executable](http://stackoverflow.com/questions/1528298/get-path-of-executable) – 001 Oct 05 '16 at 14:02
-
Still not platform independent but you might be able to use the current working directory (should be possible to get using `std::filesystem`) and resolve an absolute path using `argv[0]`. – Some programmer dude Oct 05 '16 at 14:06
-
There is no requirement that an executable even *has* a path, so it will be system specific anyway. – Bo Persson Oct 05 '16 at 14:15