Receiving error when compiling
invalid operands of types double[100]' and
double[100]' to binary `operator*'
The code looks like as follows. Trying to submit for homework this evening, and I'm stuck!!!
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <iomanip>
using namespace std;
int main(int argc, char *argv[])
{
double employeeSalaryRaises[100];
double employeeSalaries[100];
string employeeFirstNames[100];
string employeeLastNames[100];
int counter;
double salary;
string firstName;
// string lastName;
double raise;
int newSalary;
double employees;
ifstream inFile;
ofstream outFile;
inFile.open("Ch5_Ex2Data.txt");
outFile.open("Ch5_Ex2Output.txt");
// int i;
counter = 0;
//check to ensure there is a valid input file
if (!inFile)
{
cout << "Input file failed." << endl;
cout << "Program Terminates!!!" << endl;
cout << " " << endl;
system ("PAUSE");
return 1;
}
while (!inFile.eof())
{
inFile >> employeeLastNames[counter] >> employeeFirstNames[counter] >> employeeSalaries[counter] >> employeeSalaryRaises[counter];
counter = counter + 1;
newSalary = employeeSalaries * employeeSalaryRaises /100
}
double temp;
int index;
int i;
for(i=0; i< counter; i++)
{
for (index =0; index < counter -i -1; index++)
{
if ( employeeSalaries [index] < employeeSalaries [index + 1])
{
temp = employeeSalaries[index];
employeeSalaries[index] = employeeSalaries[index +1];
employeeSalaries[index +1] = temp;
}
}
}
string lastName;
for (i=0; i<counter; i++)
{
employees = employeeSalaries[i];
outFile << fixed << showpoint;
outFile << setprecision(2);
outFile << "Record " << i << ":" << employees << " " << endl;
cout << fixed << showpoint;
cout << setprecision (2);
cout << "Record " << i << ":" << employees << " " << endl;
}
system("PAUSE");
return EXIT_SUCCESS;
}