Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct library *deleteBook(struct library* head, char choiceBook[50]){
- struct library *next,*start,*end,*temp,*bfrEnd,*t;
- start = head;
- next = head -> next;
- temp = head;
- end = head;
- bfrEnd = head;
- for (temp = head; temp -> next != NULL; temp = temp->next){
- for(bfrEnd = head; bfrEnd -> next != end; bfrEnd = next -> next ){
- for (end = head; end -> next != NULL; end = end->next){
- }
- }
- //start
- if(strcmp(start -> collection.title, choiceBook) == 0){
- copybook(&(start->collection), &(end -> collection));
- next = head;
- bfrEnd -> next = NULL;
- free(end);
- }
- //between
- if(strcmp(temp -> collection.title, choiceBook) == 0){
- copybook(&(temp->collection), &(end -> collection));
- bfrEnd -> next = NULL;
- free(end);
- }
- }
- if(strcmp(end -> collection.title, choiceBook) == 0){
- bfrEnd -> next = NULL;
- free(end);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement