Finding current executable's path without /proc/self/exe

前端 未结 13 1102
有刺的猬
有刺的猬 2020-11-22 01:06

It seems to me that Linux has it easy with /proc/self/exe. But I\'d like to know if there is a convenient way to find the current application\'s directory in C/C++ with cros

13条回答
  •  我在风中等你
    2020-11-22 01:34

    You can use argv[0] and analyze the PATH environment variable. Look at : A sample of a program that can find itself

提交回复
热议问题