From 223d9acafb7612bdd6c09d88ede593c360ec089c Mon Sep 17 00:00:00 2001 From: Anton Date: Tue, 8 Oct 2024 15:45:13 +0200 Subject: [PATCH] Initializacia --- cv3/program.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cv3/program.c b/cv3/program.c index 5654e5b..60e0c23 100644 --- a/cv3/program.c +++ b/cv3/program.c @@ -1,5 +1,8 @@ #include #include +#include +#include +#include #define LINE_SIZE 100 #define STACK_SIZE 100 @@ -17,8 +20,8 @@ void print_stack(struct stack* stack){ } int main(){ - char input[LINE_SIZE]; float y; - memset(&mystack, 0, sizzeof(struct stack)); + char input[LINE_SIZE]; float y; struct stack mystack; + memset(&mystack, 0, sizeof(struct stack)); while(fgets(input, LINE_SIZE, stdin) != NULL){ input[strlen(input - 1)] = '\0'; @@ -27,7 +30,7 @@ int main(){ assert(mystack.size < STACK_SIZE); mystack.values[mystack.size] = y; mystack.size ++; - } esle{ + } else{ return 1; } print_stack(&mystack);