quick question about declaring an array

So I can't just declare it at the beginning of the loop? I have to use Malloc? Is the array freed at the end of the function automatically?

What I mean is, at the end of the function, Im done with the array. I entirely refill the array when the function starts again. So what do I need to do to free it at the end of the function?