What you're talking about is known as dynamic allocation and it's done a little differently to the normal allocation (which happens is a different part of memory), to do this in C you use a function from stdlib.h (remember to #include it) called calloc which takes two arguments the number of elements and the size of each element, so assuming you want an array of chars the code would look something like this:
char *array;
int main(void)
{
int maxsize;
scanf("%d", &maxsize);
array = calloc(maxsize, sizeof(char));
}
you'll notice that there is no [] after the declaration of array, that's because it is not an array but rather a pointer, but no fear you can still access indices like an array. So array[1] will still work provided you have at least 2 elements in the array.