Reading files into arrays

We generally read files into an array if the records are going to be accessed in random order, but in our earlier examples, we processed records in sequential order, so did not bother to read them into an array in memory.

Can you think of circumstances under which you might want to read a file into an array even if it were going to be processed sequentially?

Explain your answer.


Disclaimer: The views and opinions expressed on unofficial pages of California State University, Dominguez Hills faculty, staff or students are strictly those of the page authors. The content of these pages has not been reviewed or approved by California State University, Dominguez Hills.