yet another primary-expression compiler error

Could someone help me with this primary expression compiler error?

proj7.cpp:52: error: expected primary-expression before ';' token
admiral% vi proj7.cpp
"proj7.cpp" 55 lines, 1180 characters
// finding the sum of #s in a file.
#include <iostream>
#include <iomanip>
#include <fstream>

using namespace std;

int main()
{

const int size = 15;
int score[size];
int count = 0;
ifstream inFile;

// open file
inFile.open("p6.dat");

while (count < size && inFile >> score[count]);
count++;


// averages per student
int total = 0;
double average = 0, average1 = 0, average2 = 0, average3 = 0, average4 = 0, three = 3;

cout << fixed << showpoint << setprecision(2);

for (count = 0; count < three; count++)
{total += score[count];
average = total / three;}
cout << average << " " <<;

for (count; count < 3; count++)
{total += score[count + 3];
average1 = total / 3;}
cout << average1 << " " <<;

for (count; count < 3; count++)
total += score[count + 6];
average2 = total / 3;
cout << average2 << " " <<;

for (count; count < 3; count++)
total += score[count + 9];
average3 = total / 3 ;
cout << average3 << " " <<;

for (count; count < 3; count++)
total += score[count + 12];
average4 = total / 3;
cout << average4 << " " <<;

return 0;
}






these are the chunks causing the problems:
for (count = 0; count < three; count++)
{total += score[count];
average = total / three;}
cout << average << " " <<;



for (count; count < 3; count++)
{total += score[count + 3];
average1 = total / 3;}
cout << average1 << " " <<;
Your cout's...

Change
cout << average << " " <<;

To
cout << average << " ";

Your compiler should have an error message about cout::operator<< taking two operands, but whatever. How you have it makes no sense.


Also,
count < three

What is 'three' here?
Okay, awesome. That did the trick for now, thanks. I figured it was something stupid I was missing.


For "three": I was messing around, trying to fix the problem. I tried using constant ints over 3.
Topic archived. No new replies allowed.