Push: nur malloc ohne Variable*

This commit is contained in:
Jochen Duernberger 2025-12-11 12:00:06 +01:00
parent ce903c6d4f
commit b3f1298149
5 changed files with 2 additions and 2 deletions

BIN
bintree.o

Binary file not shown.

BIN
doble.exe

Binary file not shown.

View File

@ -1,4 +1,5 @@
Player1;19887
Player1;19843
Lena;19811
Lena;19702
Player1;19578
@ -7,4 +8,3 @@ Lena;9980
Lena;9978
Lena;9978
Lena;9976
Lena;9975

View File

@ -4,7 +4,7 @@
// Push Daten auf den Stack legen.
StackNode *push(StackNode *stack, void *data)
{
StackNode *node = (StackNode *)malloc(sizeof(StackNode));
StackNode *node = malloc(sizeof(StackNode));
if(node == NULL)
return stack; // allocation failed -> return unchanged stack

BIN
stack.o

Binary file not shown.