in reply to Reading file contents into an array

In your code, there are two things you need to be aware of: