Accessing values read from an SD card in setup() and loop()

There's a couple of ways to do this. The 'Arduino way' is to set aside some global storage which is larger than you could ever want to use. If you think you could never ever possibly have more than 100 items, then just assign an array of length 100. The compiler will warn you if you run out of memory.

The 'C way' is to have a global pointer. As the array expands, use malloc() to allocate more memory. This will work fine on the Arduino until you accidentally allocate more memory than the Arduino has available. Then unpredictable things happen. None of them good.

The 'C++ way' is to create a class to store the data and the methods which operate on the data. This can be done on the Arduino as it is C++ underneath but you end up choosing one of the above methods inside the class.