I wrote a piece of C code as below:-
typedef struct {
unsigned int buffer_ctrl[4];
unsigned int buffer1[10];
unsigned int buffer2[40];
unsigned int buffer3[20];
unsigned int buffer4[15];
unsigned int *buffer_ptr[4] = {buffer1, buffer2, buffer3, buffer4};
unsigned int canary[4];
} buffer_t;
I wrote this in a header file which I included in a main code. I had read up a lot of examples on jagged array in C and thought this would work just fine. One of the links was Do jagged arrays exist in C/C++?.
However, when I compile I get the error "expected ';' at end of declaration lsit". Can someone please help explain what might be the error here? Thanks!