Push: nur malloc ohne Variable*
This commit is contained in:
parent
ce903c6d4f
commit
b3f1298149
@ -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
|
||||
|
||||
2
stack.c
2
stack.c
@ -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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user