Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void search(list cur)
- {
- int maxYear = 0; //
- char inputName[50]; //
- DataType book; //
- system ("CLS");
- if(cur == NULL)
- {
- printf("List is empty\n");
- getchar();
- return;
- }
- printf("Search year fixed, since 2001\n\n");
- printf("Author's last name: ");
- scanf("%s", inputName);
- getchar();
- while(cur)
- {
- if((strcmp(inputName, cur->data.author) == 0) && cur->data.yearOfPublication > 2000)
- {
- maxYear = cur->data.yearOfPublication;
- book = cur->data;
- printf("\n--------------------\n");
- printData(book);
- printf("\n--------------------\n");
- }
- cur = cur->next;
- }
- if(maxYear == 0)
- {
- printf("There are no such records\n");
- }
- printf("---\nPress any key to continue . . ."); getchar();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement