I have a very simple C code for constructing a Singly Linked list as below, in which I allocate memory for each node dynamically using malloc. At the end of code, I want to
I use something like this:
for (p = curr; NULL != p; p = next) { next = p->next; free(p); }