From 73c5bf6d9676ea1a0ee1069584dd0975e4a8bcd1 Mon Sep 17 00:00:00 2001 From: Maryna Kravtsova Date: Sun, 22 Nov 2020 18:16:42 +0100 Subject: [PATCH] buffet --- cv8/program.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cv8/program.c b/cv8/program.c index 9b14fab..ec6fadd 100644 --- a/cv8/program.c +++ b/cv8/program.c @@ -27,20 +27,20 @@ struct tree* read_tree(int* counter){ struct tree* node = calloc(1,sizeof(struct tree)); memcpy(node->value, buffer,50); *c += 1; - counter = &c; + counter = c; if(buffer[0] != '*'){ if(node->left == NULL){ - node->left = read_tree(); + node->left = read_tree(counter); } if(node->right == NULL){ - node->right = read_tree(); + node->right = read_tree(counter); } } if(node->left != NULL && node->right != NULL){ *c -= 2; - counter = &c; + counter = c; } - if(c == 1){ + if(*c == 1){ r = fgets(buffer,50, stdin); //int x = strlen(buffer); // buffer[x-1]='\0';