this is the function witch is used to print all words in the tries .But some time I am getting error .Can't understand where went wrong ???please help me..thanks a lots.
typedef int boolean;
typedef struct test_struct test_struct_t;
struct test_struct {
boolean end;
int freq;
char* word;
test_struct_t *next;
test_struct_t *child[26];
};
typedef struct trie trie_t;
struct trie {
struct test_struct *root;
int count;
};
void printContent(test_struct_t *head) {
for(int i=0;i<26;i++) {
if(head->child[i]->w!='1') {
if(head->child[i]->end==TRUE) {
printf("%s (%d)\n",head->child[i]->word,head->child[i]->freq);
}
printContent(head->child[i]);
}
}
}