I have function like this for delete my 2 dimensional struct, but it is not too fast, i guess there is a much faster way to do this(Like memset or something), any idea would be appreciated;)
void freeAlllistNode(LISTNODEPTR *sPtr[][10])
{ LISTNODEPTR temp;
for (char i = 0; i<19; i++){
for (char di = 0; di<10; di++){
while (sPtr[i][di] != NULL){
temp = *(sPtr[i] + di);
*(sPtr[i] + di) = temp->next;
free(temp);
}
}
}
}
And this is my struct definition, in case if it's necessary
typedef struct listNode{
char* val ;
struct listNode *next;
}LISTNODE;
using LISTNODEPTR = LISTNODE*;