Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (o_cur = lo->head, o_prev = NULL; o_cur != NULL; o_prev = o_cur,
- o_cur = o_cur->next)
- {
- if (o_cur == o)
- {
- if (o == lo->head && o == lo->tail)
- {
- lo->head = NULL;
- lo->tail = NULL;
- }
- else if (o == lo->head)
- {
- lo->head = o->next;
- }
- else if (o == lo->tail)
- {
- lo->tail = o_prev;
- o_prev->next = NULL;
- }
- else
- {
- o_prev->next = o_cur->next;
- }
- free(o);
- lo->num--;
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement