hi there.
I encountered a problem when i wanted to open a file which name i read from an ini file.
FILE *fopen(const char *filename, const char *mode);
as far as i know, fopen( ) accepts only constants as parameters.
that's my code:
FILE *fp;
if((fp = fopen(logfile, "a")) == NULL)
fprintf(stderr, "\n\n*** unable to open %s", logfile);
where logfile is a string containing "logfile.log".
the borland compiler doesn't give an error, I just see always
*** unable to open "logfile.log"
if i write this:
fopen("logfile.log", "a"))
it works...
how can i open this file through a string?
greetings.