Const char foo[] = "gives me an error"

OK, but why the inconsistent behaviour between declaring a flexible array in a class or struct compared to as a normal global or local variable, particularly when declared as const ?

Rather amusingly, if you declare the flexible array in a struct anywhere than as the last struct member you get this error message

flexible array member 'test::anArray' not at end of 'struct test'

then if you move it to the end of the struct as suggested you get

initializer for flexible array member 'char test::anArray []'

instead :grinning: