This read statement is supposed to fill up a previously declared and initiallized binary search tree with the contents of fill.txt,Code:#include "bst_inter.h" void bst_letter_fill ( tree_t *T ) { FILE *in; char read; bst_item data; int check; in = fopen("fill.txt", "r"); while (fscanf(in, "%c ", &read) != EOF); { data.code = read; data.key = read; bst_insert(T, &data); } fclose (in); }
E A R I O T N S L C U D P M H G B F Y W K V X Z J Q
but is only going through the while loop once, recording Q. Any ideas why that is happening, and not recording the entire text file? It should be some simple, stupid reading error. Any help is appreciated![]()



LinkBack URL
About LinkBacks



