Cannot build

The void read section is where I have issues at. Please tell me what's wrong. And if there is anywhere else I need to look at. Thank you in advance.


A company hired 10 temporary workers who are paid hourly and you are given a data file that contains the last name of the employees, the number of hours each employee worked in a week, and the hourly pay rate of each employee. You are asked to write a program that computes each employee’s weekly pay and the average salary of all the workers. The program then outputs the weekly pay of each empl
Last edited on
You say "issues". I would expect your compiler to be able to be much more verbose.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const int column=3;
const int row=10;

void read(string row[], double matrix[][column])
{
	// Does "row" refer to global int variable or local string array?
	for(int r=0; r<row; r++)
	{
		// Nobody told us about any "lastname" array and neither "row" fits the bill here
		row>>lastname[r];
		// Not filling the last column. Why?
		for (int c=0; c<column-1; c++)
		{
			// Who is "read" here?
			read>>matrix[r][c];
		}

		// Magical third column override.  Luckily, 2<column. This time.
		matrix[r][2]=0;
	}
}

Overall, reading input without checking for failure is ok only as long as the input is exactly what you expect.
Topic archived. No new replies allowed.