This is the choice:
printf("\t1. Add new book record");
printf("\n");
printf("\t2. Edit book title");
printf("\n");
printf("\t3. View all the books");
printf("\n");
printf("\t4. View a specific book");
printf("\n");
printf("\t5. Delete a book");
printf("\n");
printf("Your choice:\t");
scanf("%d", &ch);
printf("\n");
After which it goes to another function depending on the user's input. Everything else works fine except for adding a new book record. The program skips the first fgets() where the user is asked to input the number of the book, it instead goes directly to the second fgets() which works fine.
Here is my code for getting the information:
void getInfo(BOOK *data)
{
printf("Enter Book Number: ");
fgets((*data).bkNum,M, stdin);
printf("Enter Book Title: ");
fgets((*data).bkTitle, M, stdin);
printf("Enter Book Author: ");
fgets((*data).bkAuthor, M, stdin);
printf("Enter Book Copyright: ");
scanf("%d", &(*data).bkCopyright);
return;
}