You need to do some debugging to see what the code is doing.
See post#20


Continued at: Im having trouble storing ints that have been converted at the end of a line in a file into a 2d array.