- 46 名前:デフォルトの名無しさん mailto:sage [2018/09/22(土) 03:03:32.99 ID:16ZpsTnK0.net]
- >>36、42の訂正版
int delete(int no, tag_address** ptr_head) { tag_address** ptr_tgt = ptr_head; tag_address* ptr_now = *ptr_head; while(ptr_now != NULL) { if (no == ptr_now->no) { *ptr_tgt = ptr_now->next; free(ptr_now); return 0; } if (no < ptr_now->no) return -1; ptr_tgt = &ptr_now->next; ptr_now = ptr_now->next; } return -1; } 君には余計に分かりにくくなったかもしれないけど、こんな感じ。 まあ頑張れ。
|

|