How do u pass file pointers by reference. I want to use a function to open a file but, I have trouble doing this, because once it gets out of the function the pointer isn't pointing to the file anymore. Can someone please help.
How do u pass file pointers by reference. I want to use a function to open a file but, I have trouble doing this, because once it gets out of the function the pointer isn't pointing to the file anymore. Can someone please help.
Code:FILE * Function(FILE *fptr, filename) { return fptr = fopen(filename, "r"); }