I suggest you walk though the code line by line. There are some things that don't really make sence and since I don't know exactly what you are trying to do it is hard to tell what you should do.
The function starts by reading in group[0].name and group[0].average. Then it checks to see if group[0].average > 0, if not it increments i, and... well these next two lines must spit out errors as group[i].name and group[i].average are not functions... then it loops back up and checks to see if group[1].average > 0... which we can't see since we only know what group[0].average is.
I *think* you may have meant to do the following:
CODE
void fillStructArray(ifstream &infile, Student& group[], int &count)
{
int i = 0;
string sName;
int iAverage;
while (infile)
{
infile >> sName >> iAverage;
if (iAverage > 0)
{
group[i].name = sName;
group[i].average = iAverage;
count++;
}
i++;
}
return;
}
Of course I am shooting from the hip here and I don't even know if that will compile, but I think the logic may be more of what you are looking for. This will fill an array up with names and averages as long as the average is above 0.