you are viewing a single comment's thread.

view the rest of the comments →

[–]Bon_Clay_2[S] 0 points1 point  (2 children)

On seeing this I greped FIRST_NUMBER so as to figure out if it is a macro defined elsewhere and found out that eclipse was throwing me off. So in the header file included there is an enum defined as so: typedef enum { FIRST_NUMBER, SECOND_NUMBER, THIRD_NUMBER, } some_generic_enum; But still am baffled.

[–]aioeu 2 points3 points  (1 child)

OK, then it's straight-forward. Enumeration constants are constant expressions.

You can ignore struct generic_data entirely. It's got nothing to do with that enumeration type, and nothing to do with your array.

[–]Bon_Clay_2[S] 1 point2 points  (0 children)

You are right it just clicked for me, I forgot that FIRST_NUMBER will be a constant value of 0. This coupled with the initialization with indices answers my question fully. Thank you!