A static array size cannot be a variable. If you don't know beforehand the size of your array, you must allocate a dynamic array, like this:

int *myArray = (int*)malloc(howManyItems*sizeof(int));.