Can anyone help me with a code that reads numbers from a file and puts them into a 2-D Array?
Basically the file has 1000 rows and 2 columns.
For example, a section would look like:
So I guess can someone help me understand how to write a code that would put that data into an 2-d array? (if that's even possible) Maybe the first column of numbers into one variable and the second column into the other?
This is the code I used when I tried to even see if I could read the file.
I know this isn't near what I wanted to do, but it sort of worked. Except for some reason it only read a portion of the file.
finput = fopen("numbers.txt", "r");
fscanf(finput, "%d %d ", &first_number, &second_number);
printf("%d - %d\n", first_number, second_number);
I think I might be hopeless