Hi, I am absolutly lost with this program, I have to compare data in two files and if it matches right to 3rd file. I know it can be done by comparing data while reading from the file, or storing data in an array and then comparing it.
I opened 1st file to compare with , and then I opened 2nd file, but do not understand how to do the actual comparasing.
I am only up to, I'll be appriciated for help, for some explonations...
#define F_WANT "/want.names"
int main(int argc, char *argv)
FILE *f1, *f2, *out;
char want_file; /* declaring a strings to hold contents of the files*/
/*open want.names file*/
printf("Error open file %s.\n", F_WANT);
while(fgets(want_file,sizeof want_file ,f1)!=NULL) /*put contents of the want.names into want_file*/
/* put data into 2 dimentional array */
/*open topps.xx files using for loop to compare contents with want.name */
for(i=1; i<=12; ++i)
printf("Error open file %s\n", fn);
while(fgets(topps_file, sizeof topps_file, f2)!=NULL)
topps[i] = input;