Open ehboudjema opened 6 years ago
Which line is it saying is the error? You haven't specified that.
It is on line 8: char arr[((Enum)1)] = "a";
The code is a little weird, but it should parse because it is indeed a constant. I would recommend trying to figure out what the bug is by diving in to the code, it's the only way you're going to get it fixed.
I have the error : Error: Initializing non-constant-length array with the following C code :
typedef enum { A = 0, B = 1 } Enum;
int main (){ char arr[((Enum)1)] = "a"; printf("%s\n",arr); }
The code above compiles and runs correctly using GCC.