Calling a function to do fopen
Hi, I'm having some troubles with openning a file that I need to read. I think it's because I'm handling the FILE* wrong or something. But I'm a little confused about this. Hopefully someone can clarify it a bit for me please.
Basically I have a function that I call from a calling function in another source file to open a ttext file. I've got all the extern stuff working so that it compiles and all. The relevant part for my open file function is below.
Code:
int Open (FILE** FileStream) {
.
.
*FileStream = fopen (/*path and mode here*/);
.
.
}
In my calling function, I declare a FILE* variable and pass it to Open like so.
FILE* FileStream;
int i;
i = Open (&FileStream);
But when I run the program, it says can't open the file. So what exactly is wrong with the way I'm passing the FileStream to the Open function? Thanks a lot for your help.