An array of problems

My arrays are giving me fits. I can't get the void computeSums or the void computeAvgs to work. The data is going into the array just fine but I can't get the sums and avgs to work. I think I'm close...

The data coming in...

8 27 33 14
81 146 305 249
412 71 226 4
144 55 97 493
133 265 788 246
380 117 88 25
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
  #include <iostream>
#include <string>
#include <iomanip>
#include <fstream>
#include <cmath>




using namespace std;

void computeSums(int fishArray[][4], int rowSum[], int colSum[]);
void computeAvgs(int rowSum[], int colSum[], double rowAvg[], double colAvgs[]);


int main()
{

	ifstream FileIn;
	ofstream FileOut;

	FileIn.open("D:\\Datafile3.txt");
	FileOut.open("D:\\FISHDATA2015.TXT");

	int row, column;
	int fishArray[6][4];

	for (row = 0; row < 6; row++)
	for (column = 0; column < 4; column++)
		FileIn >> fishArray[row][column];

	cout << setw(21) << "Cropi" << setw(8) << "Bass" << setw(10) << "Catfish" << setw(8) << "Trout"
		<< setw(8) << "Sums" << setw(10) << "Averages" << endl << endl;
	for (row = 0; row < 6; row++)
	{
		cout << "Keystone" << row + 1 << "   ";
		for (column = 0; column < 4; column++)
		{
			cout << setw(8) << fishArray[row][column] << computeSums << computeAvgs;
		}

		
		cout << endl << endl;

		





	}



}

void computeSums(int fishArray[][4], int rowSum, int colSum[])
{
	int row = 0, column = 0;

	for (row = 0; row < 6; row++)
	{
		cout << setw(2) << fishArray[row] << setw(10) << rowSum[row] << endl;
	}
}

void computeAvgs(int rowSum[], int colSum[], double rowAvg[], double colAvgs[])
{
	int row = 0, column = 0;

	for (row = 0; row < 6; row++)
	{
		
		
		for (column = 0; column < 4; column++)
		{
			cout << setw(10) << rowSum[row] / 4.0 << endl;
		}
	}
}
Topic archived. No new replies allowed.