First, you should do it inside a function body. Then, the syntax of using the braces is illegal, because you assign them to a pointer, not to an array or struct. That syntax is also only valid when initializing, not during assignment.
The code is probably using compound literals, and some programmer removed the necessary type name:
void some_function(void) {
struct wOCR_matchGrid alphaMatch[26];
alphaMatch[0].character = 'A'; /*8*/
alphaMatch[0].data = (int[]){ /*9*/
0, 1, 0,
1, 0, 1,
1, 1, 1,
1, 0, 1
};
};
Note the parenthesized int[]
i added. That will tell GCC to create an unnamed array living for the lifetime of that function invocation, and assign the address of it to the .data
pointer. This is not a cast in this case, but it's essential for this syntax to work and to create an array compound literal. These compound literals, however, are a C99 feature, and don't work in every compiler.