Initializacia

This commit is contained in:
Anton 2024-10-08 15:45:13 +02:00
parent a1242f315f
commit 223d9acafb

View File

@ -1,5 +1,8 @@
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<ctype.h>
#include<assert.h>
#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);