Doblespiel/doblespiel/test_stack.c
2025-12-10 21:02:55 +01:00

37 lines
673 B
C

#include <stdio.h>
#include <stdlib.h>
#include "stack.h"
int draufundentfernen(StackNode *stack){
//erst ein paar stacks drauf oben
int i = 3;
int j = 8;
int m = 2;
push(stack, i);
if (top(stack) !=i)
{printf("Fehler");}
push(stack, j);
if (top(stack) !=j)
{printf("Fehler");}
push(stack, m);
if (top(stack) !=m)
{printf("Fehler");}
if (top(stack) ==j)
{printf("auf stack hat geklappt");
}
//dann alle wieder entfernen
pop(stack);
if (top(stack) !=j)
{printf("Fehler");}
pop(stack);
if (top(stack) !=m)
{printf("Fehler");}
pop(stack);
if (top(stack) !=i)
{printf("Fehler");}
printf("Drauf und runter funtkioniert!");
}