what is the proper looping method for freeing a single linked list?
I've never seen this done and my attempt at it is crashing. I am sure that this can be done in a few lines of code.
I tried this:
Thanks.Code:do { list=list->next; free(list); } while(list);