Initializacia
This commit is contained in:
parent
a1242f315f
commit
223d9acafb
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user