Possible Duplicate:
how to find the location of the executable in C
I’m writting an multi-platform app in C++ using GTK+ and I have a problem. I must get program path. E.g., when program is in /home/user/program (or C:\Users\user\program.exe), i have /home/user/ (or C:\Users\user\).
Can and how I can do this?
argv[0]contains the program name with path. Am I missing something here?