Code:
void viewBooks(){
printf("Displaying all books...\n");
for(int i = 0; i< count;i++){
// printf("%d. Bookname %s \n Book Serial %ld\n",i+1,books[i].title,&books[i].serial);
printf("Book name : %s \n",books[i].title );
printf("Book Serial: %ld \n",books[i].serial);
printf("Authors name : %s \n",books[i].author );
printf("Book year %d\n",books[i].yearOfPublication);
}
delayMessage();
}
this is where i call the function
and this is my main method
Code:
int main(){
char delay;
int numSelected,i;
do{
runMainMenu();
scanf("%d",&numSelected);
switch(numSelected){
case 1: addBook(); break;
case 2: deleteBook(); break;
case 3: viewBooks(); break;
case 4: viewABook(); break;
case 5: printf(" "); break;
}
}while(numSelected != 5);
return 0;
}
when i select the number 3 it shows the books and the mainmenu comes back.....
the delay message should come up after showing the boook details