I didn't really get what you mean by dynamically. Do you mean dynamic allocation? Arrays are not meant for dynamic allocation as they have a defined sizes that don't change(static).
For dynamically allocating data to a set that can increase or decrease in size you would have to go for another type of data structure that is based on a
Linked data structure such as a LinkedList, Vector, ArrayList etc... It would be good for you to read how they differ in terms of how they get allocated for in memory.
EDIT: Since your code is in C I guess what you're looking for might be this
this which is about dynamically defining the size of an array at runtime and not compile time.