ARRAYS

I am getting an error when checking my code.

error c2664: 'void getEmployeeData(int,int)' : cannot convert arugument 1 from 'int[7]' to 'int'

what am i doing wrong?


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
  #include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <iomanip>
#include <cstdlib>
#include <fstream>
using namespace std;

int const ARRAYSIZE = 7;
void getEmployeeData(int empID, int);


int main()
{
	int empID[ARRAYSIZE] = { 5658845, 4520125, 7895122, 8777542, 845277, 1302850, 7580489 };
	double hours[ARRAYSIZE];
	double payRate[ARRAYSIZE];
	double wages[ARRAYSIZE];

	getEmployeeData(empID, ARRAYSIZE);

	system("pause");
	return 0;
}
void getEmployeeData(int empID[], int ARRAYSIZE)
{
	for (int i = 0; i < ARRAYSIZE; i++)
	{
		cout << "*****************" << endl;
		cout << "List of Employees" << endl;
		cout << "Employee ID # : " << empID[i] << endl;

	}
}
void getEmployeeData(int empID, int);

should be

 
void getEmployeeData(int empID[], int);
LMAO i saw that right after i posted this. Now i feel stupid
Topic archived. No new replies allowed.