Omer Erbilgin
Omer Erbilgin

Reputation: 15

Is there a way of getting the executable file's name in C without using argv[0]

This question is just out of curiosity. I thought there might be a predefined macro or something but couldn't find anything. If impossible, is it appropriate to use a constant global variable initiated with argv?

I really don't know why the question was closed. The stated justification is that an answer already exists here:Finding current executable's path without /proc/self/exe

The referred question has platform-specific answers and is also tagged with C++, which is a whole different story on the topic with boost. I just tagged C and compiler-constants just in case there is a method I didn't know about to accomplish the task of keeping track of the executable file identifier.

Upvotes: 0

Views: 30

Answers (0)

Related Questions