dynamic array? or varrying the size of the array based on something?

Graynomad:
Just allocate space for the largest eventuality and save yourself some heartache.

Sounds like the best idea to me. I guess you are using the array as a FIFO buffer to work out a rolling average. In that case you would presumably be using it as a circular buffer. You can change the capacity of a circular buffer very easily, just by subtracting a value from the capacity calculation to prevent the buffer from filling beyond a threshold. If it's really just being used as an array then of course you can change the effective size even more easily, just pretend the array is the size you need and ignore any excess elements.

A less precise but much easier approach would be to calculate a decaying average, in which case you don't need to remember historical results at all.