pop-Funktion angepasst, erfolgreich getestet

This commit is contained in:
haemmerlre98889 committed 2025-12-10 09:54:54 +01:00
1 parent 2dc724e065
commit 1a5b7cb025
2 files changed
+2 -7

No files matched your search

+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.