I've written some lines of code to implement the trie alogorithm for loading the dictionary. I'm facing the following issue:

  1. Compiling speller.c is giving me some errors, one of which is the below:

enter image description here

I wanted to place the character at dictionary[0] to the root -> dependent[k] position (line 41 in below code link), which, I guess, is not allowed with the current syntax. How am I then supposed to place the character at this position.

  1. Within the else statement (line 62 in below code), I was planning to recursively create a new_node till the length of the word. But the current syntax seems wrong as compiler is throwing a couple of errors on this line. Can you suggest how do I go on implementing this line?

  2. Is there a way to check the correctness of the load function without implementing the other 3 functions?

Here is the code: http://pastebin.com/e0EKFBbq

Thanks in advance.

P.S. It is still a work in progress and I've only now concentrated on loading the dictionary using trie.


Well, the immediate problem is that the compiler doesn't like using the constant char variable like an array. You could get around that by copying the contents of dictionary to an actual char array.

However, there's a much bigger problem. dictionary only contains the file name of the dictionary, not the words to be loaded. You need to actually open the file and read the words from it to load the dictionary.

If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .