Can we do something like asking the user for the value of a variable, say "size" and then doing later in the code something like:
int array[size];
? If no, why?
Yes you can. Say you want an array of integers, you can do it like that:
printf("What is the length of the array?\n");
int n = GetInt();
int numbers[n];
for (int i = 0; i < n; i++)
{
numbers[i] = GetInt();
}