My intention is to get the name of the running executable file,in every platform (Windows,Mac Os x,Linux) with the same code.
There are separate code for each platform to find the name of the executable file.
In Windows there is GetModuleFileName()
function to get the name of executable,but it works on Visual Studio.
I also used argv[0]
to get the path of the current executable file.
I am using gcc
compiler,I need to generate code which works on all platform (Windows,Mac Os x,Linux) to get the name of the running executable file.