Friday, April 4, 2014

Reading text from a file as blocks

The collection is indeed not empty Sheng Jiang. I store in the loop the lines from the text file to the individual indices.

You have just created the collection, so it's empty when you try to store (or modify)

that first string.



The [] operator must reference an index which already exists. But since no strings have

yet been put in the collection, there is no valid index.



You can use the add() member to put a string into the collection.



- Wayne


No comments:

Post a Comment