pop-Funktion angepasst, erfolgreich getestet

This commit is contained in:
2025-12-10 09:54:54 +01:00
parent 2dc724e065
commit 1a5b7cb025
2 changed files with 2 additions and 7 deletions
+2 -7
View File
@@ -31,16 +31,11 @@ StackNode *push(StackNode *stack, void *data)
// freed by caller.)
StackNode *pop(StackNode *stack)
{
if(stack)
{
StackNode *t = stack->next; //Naechstes Element im Stack wird erstes Element
free(stack);
return t;
}
else
if(stack == NULL)
{
return NULL;
}
return stack->next;
}
// Returns the data of the top element.
BIN
View File
Binary file not shown.