Initializacia
This commit is contained in:
parent
f256260aca
commit
9f4c372547
@ -51,9 +51,11 @@ void run_tree(struct tree* tree) {
|
|||||||
printf("%s\n", tree->value);
|
printf("%s\n", tree->value);
|
||||||
|
|
||||||
char response;
|
char response;
|
||||||
if (scanf(" %c", &response) != 1 || (response != 'a' && response != 'n')) {
|
if (scanf(" %c", &response) != 1) {
|
||||||
error_flag = 1;
|
printf("Chybna databaza\n");
|
||||||
return;
|
return;
|
||||||
|
} else if (response != 'a' && response != 'n'){
|
||||||
|
printf("Nerozumiem\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (response == 'a') {
|
if (response == 'a') {
|
||||||
@ -99,10 +101,6 @@ int main() {
|
|||||||
|
|
||||||
run_tree(root);
|
run_tree(root);
|
||||||
|
|
||||||
if (error_flag) {
|
|
||||||
printf("Chybna databaza\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
destroy_tree(root);
|
destroy_tree(root);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user