-
read in from 2 files
Hi,everybody.
I cannot create nice code for reading in from 2 files into 2 structures.One file is having master records,another has transaction records(several transactions for each record in master).I can only move to another record in master when I read all records in transactions for the first record.
I'll appreciate anybody's help.
thanks.
-
Apparently you can't create any code, because I don't see your attempt any place...
One more time people: This is not a "do everything for me" forum. This is a "here's what i'm done, here's what i'm having problems with, here's what i need, can you please help" forum.
Quzah.
-
Code:
struct master
{
//data types
}Master_t;
struct tranaction
{
//data types
}Trans_t;
int main()
{
FILE *fptr_a;
FILE *fptr_b;
int status;
fptr_a = fopen("master","r");
if(fptr_a == NULL) exit(1);
fptr_b = fopen("transaction","r");
if(fptr_b == NULL) exit(1);
//read records
//There are different methods for reading records
//The easiest is using fscanf, however it is not the best
return 0;
}