If I have an array and all I have is an upper limit on how big the array can get, and if the number of elements that get added can be considerably smaller than this limit, is it always the right choice to declare a pointer and just reallocate extra memory whenever the array grows?
For instance, instead of declaring int a[max] I can declare a pointer int *a and than just realloc when I add elements. This would save memory. Is there any drawback to doing this?