I have a C++ question that is seemingly simple but I cannot find an answer to my situation. How do you create an array if you don't know its size ahead of time? Specifically, I want to read in files of different sizes, and want the array to only be as big as the number of elements in those files. From what I've seen with vectors and dynamic arrays, you still have to specify a size for the array. Let's say I'm reading in files and have no idea how many numbers they contain, just that they contain some list of numbers. And I want to read in each value and store it into an array.
Here's just a snippet of code. The first thing I need to do is figure out how to store the numbers from the list that's read in so that I can do calculations with those numbers later.