Is there something wrong with my syntax? Won't compile, apparently because of line: sizeof(node->sprouts) / sizeof(node)

above node defined as follows:

typedef struct node { bool is_word; struct node *sprout[27]; } node;

// and error:

dictionary.c:96:42: error: expected ')'
cor_idx = sizeof(node->spro...
dictionary.c:96:37: note: to match this '('
cor_idx = sizeof(node->spro...

I've tried assinging sizeof(node->sprouts) to a variable and declaring it as sizeof((*node).sprouts) with no luck.

Thanks :)

1 Answer 1


Hard to be exact because line 96 hasn't been posted in it's entirety. At first glance, there seems to be a mismatched parenthesis.

However, there's another problem. Assuming you didn't transcribe in a hurry, node->sprouts is undefined. It doesn't exist in node as defined. sprout exists as an array, but sprouts, with an s at the end, doesn't.

If this doesn't answer the question, please edit the question and add the missing code, including the complete line 96, the line of code before it, and the complete error, including the pointer that follows what was posted, showing the unpaired parenthesis.

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 .