program.c
This commit is contained in:
parent
f806441c6e
commit
bf296751bb
10
program.c
10
program.c
@ -25,7 +25,13 @@
|
||||
}
|
||||
|
||||
struct node* read_tree(){
|
||||
return NULL;
|
||||
char buffer[SIZE];
|
||||
memset(buffer,0,SIZE);
|
||||
char * r = fgets(buffer,SIZE,stdin);
|
||||
assert(r);
|
||||
struct tree* node = calloc(1,sizeof(struct node));
|
||||
memcpy(node->value,buffer,SIZE);
|
||||
return node->value;
|
||||
}
|
||||
|
||||
void traverse(struct node* tree){
|
||||
@ -50,6 +56,6 @@
|
||||
|
||||
printf("Pozna %d druhov ovocia a zeleniny.\n",count_fruit(tree));
|
||||
printf("Odpovedajte 'a' alebo 'n'\n");
|
||||
traverse(tree);
|
||||
traverse(tree);
|
||||
delete_tree(tree);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user