hi
i have the folowing problem: i wrote a small comandline programm, that works on textfiles. it's behavior can be configured in a file called keywords.cfg. this file shall be in the same directory as the exe (named cc.exe).
the problem now ist, that if working in another dir (e.g. c:\temp) this programm is looking for the configfile in the curent working directory:
I usuali solved this by simply searching in all the folders which are namend in the path variable. but this wan't do here, because the file won't be in a directory anywhere in the path. it will be called by a batch.Code:if((fkey=fopen("keywords.cfg","r"))==NULL) printf("\"keywords.cfg\" not found."); else { ... }
so what i would need, is the path to the cc.exe. but how can i get this?
thanks