Q: How can I automatically locate a program's configuration files in the same directory as the executable?
A: It's hard, in general; it's an equivalent problem to the one in question 19.31. Even if you can figure out a workable way to do it, you might want to consider making the program's auxiliary (library) directory configurable, perhaps with an environment variable. (It's especially important to allow variable placement of a program's configuration files when the program will be used by several people, e.g. on a multiuser system.)