Code to locate the C file currently running

Asked 2 years ago, Updated 2 years ago, 116 views

How do I find the location (absolute path) of the C file currently running in the code?

I want argv[0] to accept it, but he doesn't.

linux c++ unix

2022-09-21 18:42

1 Answers

(Because of setuid, the method of writing argv[0] may have reliability issues.)


2022-09-21 18:42

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.