Reading lines of integers from a file
Posted on 2003-03-11
I'm trying to read lines of integers from a file in which there is one integer per line, after which I should be able to read a specific integer by calling its respective line number. I figured I would be able to read the sizeOf the file and mallocate some memory for an array that would store the integers from the file, and that I could use the index of the array to represent the line numbers of the file. While I'm sure this would work, I was wondering if there is another, simpler, way of doing this without the use of an array. Thanks in advance.