function clearStack is done

This commit is contained in:
regis37 2025-11-26 23:01:16 +01:00
parent 5deaf21a61
commit 3abe1477ac

View File

@ -41,5 +41,12 @@ return stack->data;
// Clears stack and releases all memory.
void clearStack(StackNode *stack)
{
StackNode *current = stack;
while (current != NULL)
{
StackNode *next = current->next;
free(current);
current = next;
}
}