int main()
{
int number, sum1, sum2, counter, limit, integer;
ifstream inFile;
ofstream outFile;
inFile.open("Lab5data");
sum1 = 0;
sum2 = 0;
counter = 0;
while (inFile)
{
inFile >> number;
number / 2 = integer;
22 if (integer = 0);
sum1 = sum1 + integer;
counter++;
27 else
sum2 = sum2 + integer;
counter++;
}
cout << "The sum of the even integers read is " << sum1 << endl;
cout << "The sum of the odd integers read is " << sum2 << endl;
system("pause");
return 0;
}
I am getting an error saying Error error C2106: '=' : left operand must be l-value (line 22), and Error error C2181: illegal else without matching if (line 27)
I'm not really sure why the compiler is saying these things, please help!