next;
}
// Remove the entry by updating the
// head or the previous entry
if (!prev)
head = entry->next;
else
prev->next = entry->next;
}
remove_list_entry(entry)
{
// The "intransparent" pointer points to the
// *address* of the thing we'll update
intransparent = &head
//Walk the list, looking for the thing that
// points to the entry we want to remove
while((*intransparent) != entry)
intransparent = &(*intransparent)->next;
// .. and just remove it
*intransparent = entry-> next;
}" data-snippet-id="ext.ef0d7ff73d9567dbb0909bd8a8233cfe" data-snippet-saved="false" data-codota-status="done" style="font-size: 13px; color: rgb(0, 0, 0); background-image: initial; background- initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; -webkit-user-select: auto;">
remove_list_entry(entry) { prev = NULL; walk = head; //Walk the list while (walk != entry) { prev = walk; walk = walk->next; } // Remove the entry by updating the // head or the previous entry if (!prev) head = entry->next; else prev->next = entry->next; } remove_list_entry(entry) { // The "intransparent" pointer points to the // *address* of the thing we'll update intransparent = &head //Walk the list, looking for the thing that // points to the entry we want to remove while((*intransparent) != entry) intransparent = &(*intransparent)->next; // .. and just remove it *intransparent = entry-> next; }
http://gall.dcinside.com/board/view/?id=programming&no=635724&page=2
아 왜안나와
함수?
쇼트코딩이 근데 어느 정도는 가독성을 헤치지 않냐 - return 0;