Hello, I have a little problem:
I need to free a linked list and for some reason the function FreeList I wrote doesn't work.
The list simulates a matrix and so each struct hold 2 pointers:
one pointer is "right" and the other is "down".
I have the anchor of the list (head) which is the upper left struct.
I wrote:
Does anyone have an idea why it doesn't work properly?Code:void freeArray( Array * head ) { if(!head) return; freeArray(head->right); freeArray(head->down); free(head); }