Initializacia

This commit is contained in:
Kozar 2024-10-13 09:46:30 +00:00
parent c8d22b9589
commit b35831b691

View File

@ -24,7 +24,7 @@ void print_stack(struct stack* s) {
void push_stack(struct stack* s, float value) {
if (s->size >= STACK_SIZE) {
printf("Chyba: zasobnik je plny\n");
printf("full stack\n");
exit(0);
}
s->values[s->size++] = value;
@ -32,7 +32,7 @@ void push_stack(struct stack* s, float value) {
float pop_stack(struct stack* s) {
if (s->size == 0) {
printf("Chyba: zasobnik je prazdny\n");
printf("empty stack\n");
exit(0);
}
return s->values[--s->size];