This commit is contained in:
Maryna Kravtsova 2020-11-22 18:22:37 +01:00
parent c4bc6fada7
commit b02c3d5faf

View File

@ -11,7 +11,10 @@ struct tree {
struct tree* read_tree(int* counter){ struct tree* read_tree(int* counter){
int* c = counter; int* c = counter;
printf("%d\n", *c);
char buffer[50]; char buffer[50];
memset(buffer,0,50); memset(buffer,0,50);
char* r = fgets(buffer,50,stdin); char* r = fgets(buffer,50,stdin);
@ -156,7 +159,7 @@ int main(){
printf("Expert z bufetu to vie.\n"); printf("Expert z bufetu to vie.\n");
struct tree* tree = NULL; struct tree* tree = NULL;
int counter; int counter = 0;
tree = read_tree(&counter); tree = read_tree(&counter);
int count = count_leaves(tree); int count = count_leaves(tree);