error C2110: '+' : cannot add two pointers help please

Here is my code and the error I am getting is

1>d:\datamaxinc\datamaxinc\payrollplayfile.cpp(96) : error C2110: '+' : cannot add two pointers
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
void EmployeeClass::Addsomethingup (EmployeeClass Employ0, EmployeeClass Employ1, EmployeeClass Employ2)
{
	iTotal_salaries = Employ0.iIndividualSalary + Employ1.iIndividualSalary + Employ2.iIndividualSalary; // <-- error here
	iTotal_hours = Employ0.hours + Employ1.hours + Employ2.hours; // <-- here
	iTotal_OvertimeHours = Employ0.overtime_hours + Employ1.overtime_hours + Employ2.overtime_hours; // <-- and here

	cout << "\n\n";
	cout << "%%%%%%UNIVERSITY%OF%PHOENIX%IT%CLASSES%ROCK%%%%%\n";
	cout << "%%%% EMPLOYEE SUMMARY DATA %%%%%%%%%%%%%%%%%%%%%\n";
	cout << "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n";
	cout << "%%%% Total Employee Salaries .... = " << iTotal_salaries << " %%%%\n";
	cout << "%%%% Total Employee Hours ....... = " << iTotal_hours << "     %%%%\n";
	cout << "%%%% Total Overtime Hours ....... = " << iTotal_OvertimeHours << "      %%%%\n";
	cout << "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n";
	cout << "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n";
	cout << "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n";
	

}
Last edited on
What does EmployeeClass look like?
1
2
3
4
5
6
7
8
9
10
class EmployeeClass
{
	public:
		void ImplementCalculations(string EmployeeName, double hours, float wage);
		void DisplayEmployInformation(void);
		void Addsomethingup (EmployeeClass, EmployeeClass, EmployeeClass);
		string EmployeeName ;
		float hours, overtime_hours [3], iTotal_hours, iTotal_OvertimeHours ;
		float wage, basepay, overtime_pay, overtime_extra, iTotal_salaries, iIndividualSalary[3] ;
};
Well, iIndividualSalary by itself is a pointer. You can't just add arrays like that. Same for overtime_hours. But with hours, I don't know...
Ok you guys rock I am idiot I was sending those to an array when it was not necessary. How ever is there a way to keep this from happening just cosmetics, not to worried about it.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% EMPLOYEE SUMMARY DATA %%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Total Employee Salaries .... = 1665 %%%%
%%%% Total Employee Hours ....... = 125     %%%%
%%%% Total Overtime Hours ....... = 15      %%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Press any key to continue . . .


next to the 1665 is moved in this time however if there is a decimal place it will be correct. Something like 1665.98 would make my border correct.
Last edited on
Topic archived. No new replies allowed.