typedef struct {
void *end;
void *start;
int size;
int arrs [];
} st;
void *doStuff(void *starter, void *ender) {
st *s = (st *) malloc(sizeof(st));
s->end = ender;
s->start = starter;
int sayz = 1;
s->size = (int) (ender - starter);
int a [s->size];
memset(a, 0, sizeof a);
s->arrs = a; // This line gives error
return s;
}
the line "st->arrs = a;" gives me the "Invalid use of flexible array member" error. Does anybody know how I can save an array inside a structure? The language is C