diff --git a/du3/output/program.exe b/du3/output/program.exe index b2d48d3..7099261 100644 Binary files a/du3/output/program.exe and b/du3/output/program.exe differ diff --git a/du3/program.c b/du3/program.c index dfb1200..dee0e9f 100644 --- a/du3/program.c +++ b/du3/program.c @@ -1,6 +1,7 @@ #include #include #include +#include #define STACK_SIZE 10 @@ -10,7 +11,13 @@ struct stack { }; void push_stack(struct stack* stack, float value) { - + if (stack->size >= STACK_SIZE) { + printf("Error!\n"); + exit(1); + } + stack->values[stack->size] = value; + stack->size++; + } float pop_stack(struct stack* stack) {