Input from file into array?

I'm working on a project:
http://www.ise.ufl.edu/cgs2425/cpp/files/projects/pro6.htm.
I'm trying to take data, listed as number, space, number, new line... number, space, number, new line... etc. I need to input that data (from this text file) as two one-dimesional arrays. All of the first numbers are one array, the second numbers on each line are another. Can someone help me with this? I can set up the input stream, but I don't know the details of assigning the right numbers to the right indices of each array. Thanks, Matthew

Comments

  • Get the size of the file using filelength(int filehandle) and then create a dynamic array using malloc with the size returned by filelength,next use get to get the contents into the array.


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion