In my main function I have an array of File pointers like this:
Code:
FILE *fInfile[MAXFILE]
and my functions header is
Code:
int read_info(FILE *fA, FILE *fI);
{
.
.
.
if((fI = fopen(szFilename, "w")) == NULL)
{
fprintf(stderr, "Could not open the input file %s.\n", szFilename);
exit(1);
}
.
.
}
I call the function with the following
Code:
iSize[iTemp] = read_info(fArchive, fInfile[iTemp]);
where iTemp is the current file i want to write open
However when i go to use the file pointers they are all null. I have gotten the program to work correctly but not in the way i want too by sending iTemp as a parameter and the entire array instead.
I tried using double asterisks to send the dereference the pointer but I could not get it to work correctly could someone please help me understand what is wrong with this code.
Thanks.