i am unable to read from a file using this function. this program is part of a library management project in C so here is the update books function.
Code:
void books_update(struct books book[1000],struct book_size n)
{
int ctr=0;
int asg = (n.total_books);
FILE *in;
in = fopen("INPUT.txt","r");
if(in == NULL)
return;
while( fscanf(in,"%s%s%s%c%d\n",&(book[asg].subject) ,&(book[asg].title) ,&(book[asg].author) ,&(book[asg].type) ,&(book[asg].available) ) == 5 )
{
asg++;
ctr++;
printf("i am reading\n");
}
n.total_books = asg;
printf("\t\t\nall ARTICLES Updated Successfully...\n");
printf("--> Number of Articles added in this update %d.\n",ctr);
printf("--> Total No. of Articles in the library %d.\n\n",(n.total_books));
mystery sherlock_holmes conan_doyle b 1
info c_for_dummies unknown c 1


