StackNode *push implementiert

This commit is contained in:
Niklas Kegelmann 2025-12-02 16:11:14 +01:00
parent 1ec5d2745b
commit 0b29a58438

View File

@ -10,6 +10,15 @@
// Pushes data as pointer onto the stack.
StackNode *push(StackNode *stack, void *data)
{
//Speicher reservieren
StackNode *newNode = malloc(sizeof(StackNode));
if (!newNode)
return stack;
newNode->data = data;
newNode->next = stack;
return newNode;
}