Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void remove_list_element(line *list_head, unsigned int index) {
- line *pre = NULL;
- line *post= NULL;
- line *elem= list_head;
- unsigned int i = 0;
- if(index > 1) {
- for(i = 1; i < index; i++) {
- pre = elem;
- elem = elem->next;
- post = elem->next;
- }
- crFree(elem);
- pre->next = post;
- }else{
- pre = list_head;
- list_head = list_head->next;
- crFree(pre);
- }
- }
Add Comment
Please, Sign In to add comment