
442 Data Structures Using C
printf (“\nA/C No:”); printf(“\n%d”, Aob.Acnt_No);
printf (“\nBalance Amount:”); printf(“\n%f”, Aob.Balance_Amt);
fread (&Aob,t1,1,ptr);
ch = getch();
}
}
else
{ ptr = fopen (fname, “r”);
fread (&Tob,t2,1,ptr);
while(!feof(ptr))
{
printf (“\n A/C No:”); printf(“\n%d”, Tob.Acnt_No);
printf (“\n Transaction Type:”); printf(“\n%d”, Tob.Trans_type);
printf (“\n Transaction Amount:”); printf(“\n%f”, Tob.Trans_Amt);
fread (&Tob,t2,1,ptr);
ch = getch();
}
}
fclose(ptr);
}
9.8 DIRECT FILE ORGANIZATION
The direct files allow records to be read or written on to a file with ...