m trying to read records for a library database from a binary file.
Code:
while (fread(&lib, recsize,1,fp) == 1)
{
gotoxy (20,10);
printf("Title:");
gotoxy(28,10);
printf("%s",lib.title);
gotoxy (20,12);
printf("Author:");
gotoxy(28,12);
printf("%s",lib.author);
gotoxy (20,14);
printf("ISBN:");
gotoxy(28,14);
printf("%d",lib.isbn);
gotoxy (20,16);
printf("S.NO:");
gotoxy(28,16);
printf("%d",lib.sno);
}
my program compiles fine but when i run the function for display records. it justs skips this part. it does not enter the while loop at all. what am i doing wrong over here?
thank you