Initializacia
This commit is contained in:
parent
c8d22b9589
commit
b35831b691
@ -24,7 +24,7 @@ void print_stack(struct stack* s) {
|
|||||||
|
|
||||||
void push_stack(struct stack* s, float value) {
|
void push_stack(struct stack* s, float value) {
|
||||||
if (s->size >= STACK_SIZE) {
|
if (s->size >= STACK_SIZE) {
|
||||||
printf("Chyba: zasobnik je plny\n");
|
printf("full stack\n");
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
s->values[s->size++] = value;
|
s->values[s->size++] = value;
|
||||||
@ -32,7 +32,7 @@ void push_stack(struct stack* s, float value) {
|
|||||||
|
|
||||||
float pop_stack(struct stack* s) {
|
float pop_stack(struct stack* s) {
|
||||||
if (s->size == 0) {
|
if (s->size == 0) {
|
||||||
printf("Chyba: zasobnik je prazdny\n");
|
printf("empty stack\n");
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
return s->values[--s->size];
|
return s->values[--s->size];
|
||||||
|
Loading…
Reference in New Issue
Block a user