I declared
Code:
FILE *f = NULL;
in the main-function. Then I call a function, where I close the file f and open it again. I thought, the function prototype can look like this:
Code:
void my_function(FILE *f);
and I call it in the main-function this way:
Code:
my_function(f);
But now, in my_function, when I close the file and open it again, the pointer is messed up in the main-function.


When I have the prototype this way:
Code:
void my_function(FILE **f);
and call the function this way:
Code:
my_function(&f);
then it works, but it doesn't looks that good with the pointer to the pointer...

Any suggestions how to remove the double-pointer?

thx