When I learned C using Microsoft Visual Studio, it didn't allow me to create an array with a non-constant size. I had to either put a value like
#define size 5
printf("Enter a value: ");
for (int i = 0; i < x; i++)
arr2[i] = i;
printf("Array at %d is %d.\n", i, arr2[i]);
This is valid C. It is referred to as a variable length array (VLA). This feature was added to the language as part of the C99 standard.
MSVC is well known for not supporting many C99 and later features, including VLAs.