Bookmark Topic Watch Topic
  • New Topic

reading a user chosen file into array - multiple files  RSS feed

 
Jeff Yan
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Report post to moderator
basically, im having a little bit of coding trouble. i got to read the data from a user chosen file and then output it into an array for an algorithm to sort. the problem is that the 4 test files have different amounts of integers in, so i dont know what the initial size of the array is going to be. and it comes up with a null pointer error on runtime if i dont state the size of the array! the code itself has no syntax errors. any help appreciated. my code is listed below:




many thanks.

Jeff
 
John de Michele
Rancher
Posts: 600
  • Mark post as helpful
  • send pies
  • Report post to moderator
Jeff:

If you have a choice, don't use an array. Use a List.

John.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not post the same question to multiple forums: CarefullyChooseOneForum

Let's continue the discussion in this duplicate thread.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!