Hey,
I am learning C and I am playing around with pointers and arrays. I am trying to create an array of pointers with the code below:
const int NUM_P = 50; // Line 10
char *pS[NUM_P] = { NULL }; // Line 11
I am getting the following warnings and errors when I compile:
→ gcc array.c -o array
array.c: In function ‘main’:
array.c:11: error: variable-sized object may not be initialized
array.c:11: warning: excess elements in array initializer
array.c:11: warning: (near initialization for ‘pS’)
I cannot figure this error out, I have looked online and been unable to find a explanation and solution of the problem.
Can anyone help out?
Cheers
Eef