### use 2-dimension array of integers that has 6 rows representing the lakes and 4 columns representing the fish

OK, so I have to read integers from a file, the integers are
8 27 33 14 81 146 305
249 412 71 226 4 144 55
94 493 133 265 788 240
380 117 88 25 60

I have been able to read from the file and put them in the rows and columns, but I am having some trouble getting the sum and Average of the integers. Here is my code
 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 //This program uses a 2 dimension array to determine the population of 4 fish in 6 Oklahoma lakes #include #include #include using namespace std; ifstream DataFileIn; void ComputeSums(int twoarrays[][4], int sum[], double ColSums[]); //************************************************************************* int main() { DataFileIn.open("F:\\DataFile3.txt"); int row, column; int twoarrays[6][4]; for(row = 0; row < 6; row++) //Reads the integers from file to rows and columns for(column = 0; column < 4; column++) DataFileIn>>twoarrays[row][column]; cout<>twoarrays[row][column]; cout<

I have to do the sum and average in seperarte functions and allow the data to pass to and from the function. Any advice/assistance will be appreciated
By the way an array of 6 rows and 4 columns has 24 elements. Your file contains 25 elements.:)
I just noticed that, but unfortunately it's reading from a file our professor gave us, so we can't edit the datafile.
Topic archived. No new replies allowed.