Hi everyone. I've been trying to write a function which should open files. here it is:
problem is, the file can only be accessed from inside the function. I tried to experiment a little with all the pointer operators, but I couldn't get it to work. I'm sorry if it's an easy question that's not worth answering, but I really can't get my mind to work and get it right.
int openfile(char filename, FILE **file);
int main( int argc, const char* argv )
printf("file to be created: %s", argv);
int openfile(char filename, FILE **file)
file = fopen(filename, "wb");
By the way, my compiler does give me a few warnings (2 - one for the call and one in the function).