0

Been stuck on Speller for 2 days and could really please use some help.

My initial idea is just to create an array of linked lists with 26 buckets (N = 26) and very simply hash the words by only the first letter. I just want to create a linked list for each word in each letter bucket.

I'm getting an Expected Identifier error I'm not sure why. I declared N = 26 and I declared node *table[N] for the array. I can't imagine what else is missing. I am also trying to initially set all word values to "" and pointers to NULL for the array initially before I insert nodes. I created a for loop for this.

Any help so I can get on track would be greatly appreciated. Thank you!

my code so far

make speller

1 Answer 1

0

You should put the first for loop in the load function at the start. Loops are always supposed to be inside a function, be it main or something else. therefore the particular error is generated.

Hope this helps. If this helps then please check the tickmark.

1
  • Hi! Thanks for the comment! Yeah, I figured that. I deleted everything then I re-installed all the files and I'm slowly going over my code bit by bit. Also figured that I have to initialize values in the table array so that the pointers aren't dangling (pointing to undef). Now I'm dealing with a segmentation fault in val grind but dunno why.
    – Andrew
    Commented Nov 9, 2020 at 3:53

You must log in to answer this question.

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