Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct TElem
- {
- struct TInfo
- {
- char name[30], surname[30], patr[30];
- int day, month, year;
- } info;
- TElem *next, *prev;
- };
- void deleteIncorrect(TElem *first)
- {
- TElem *current = first;
- TElem *temp;
- while(current != nullptr)
- {
- if (1 > current->info.month || current->info.month > 12 || 1 > current->info.day || current->info.day > daysInMonthes[info.month-1])
- {
- current->prev->next = current->next;
- current->next->prev = current->prev;
- temp = current->prev;
- delete current;
- current = temp;
- }
- current = current->next;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement