Compare commits

..

No commits in common. "ce50ae30fa133688165e5091993b8bb07e8d6f97" and "eab7887e4d4e1f71b89d4a0574a99b8c37ef4b99" have entirely different histories.

2 changed files with 1 additions and 9 deletions

View File

@ -10,10 +10,7 @@
// Pushes data as pointer onto the stack. // Pushes data as pointer onto the stack.
StackNode *push(StackNode *stack, void *data) StackNode *push(StackNode *stack, void *data)
{ {
StackNode *top = malloc(sizeof(StackNode));
top->next= stack;
top->data= data;
return top;
} }
// Deletes the top element of the stack (latest added element) and releases its memory. (Pointer to data has to be // Deletes the top element of the stack (latest added element) and releases its memory. (Pointer to data has to be

View File

@ -8,11 +8,6 @@ The latest element is taken from the stack. */
#include <stdlib.h> #include <stdlib.h>
//TODO: passenden Datentyp als struct anlegen //TODO: passenden Datentyp als struct anlegen
typedef struct StackNode
{
void *data;
struct StackNode *next;
}StackNode;
// Pushes data as pointer onto the stack. // Pushes data as pointer onto the stack.
StackNode *push(StackNode *stack, void *data); StackNode *push(StackNode *stack, void *data);