Passing int array to loop() from setup()

If you truly want to create a variable sized array, you'll need to look at using malloc. The pointer to the (pointers to the) space that you allocate must still be global. The Arduino has a limited amount of memory, so dynamic memory allocation is generally to be avoided.

Creating a static array large enough for your most ambitious use is better, as long as that array fits in memory, with enough room left to run the rest of your program.