I have an executable file mzApp
(compiled c program by gcc compiler) in a directory /root/home/mzApplication
.
I run this file from another directory i.e. /root/home/check
and from this location, I issued the following command to run the application ./root/home/mzApplication/mzApp
.
Now I want to get both of the following paths in my c application
- Where exe file is located i.e.
/root/home/mzApplication
- From where this application is called i.e.
/root/home/check
Please suggest an efficient way to do this!