Embed Notice
HTML Code
Corresponding Notice
- Embed this notice
nyanide :nyancat_rainbow::nyancat_body::nyancat_face: (nyanide@lab.nyanide.com)'s status on Monday, 12-May-2025 12:26:36 JST nyanide :nyancat_rainbow::nyancat_body::nyancat_face:
Alright genuine plea of help, because I am retarded:
What's your way of destroying a linked list? Let's say it looks something like this:
struct list {
struct *list next;
char *junk; // allocated on heap
}
I don't know why I'm having a panic attack over this, I'm trying to do this in a way that doesn't mean I have repeat code I've already written inside a function designed to destroy the list.