This does work
LLIST *mylist[10] = {NULL};
But would if I wanted to do this I get errors:
int x=10;
LLIST *mylist[x] = {NULL};
x
can be any value I'm setting it to 10 for the time being. x
is going to be used as a counter.
This does work
LLIST *mylist[10] = {NULL};
But would if I wanted to do this I get errors:
int x=10;
LLIST *mylist[x] = {NULL};
x
can be any value I'm setting it to 10 for the time being. x
is going to be used as a counter.
Support for variable length arrays (which your second example uses) came in the C99 standard, which your compiler may not support.
For gcc, you should pass the -std=c99
option when compiling.