You can create arrays of non-const size
Please, consider the following code:
#include <stdio.h>
int main()
{
int length;
printf("How many element would you like to store in the array?\nElement count: ");
scanf("%d", &length);
int array[length];
printf("\nArray declaration of length %d is done...\n", length);
for (int i = 0; i < length; i++)
array[i] = i;
printf("Array is now filled with values...\n");
return 0;
}
If you run this piece of code, you can see that we can indeed allocate and use an array whose length and size was not known at compile time.
If I recall correctly, in some old version of C this was not supported, hence the restrictions you've seen. The alternative was to allocate/deallocate memory for such arrays (malloc/free). But this is not needed for two decades now or so, unless you force the compiler to use some very old (20+ years) standards.