Error
Nov 14, 2016 at 2:08am UTC
On line four I am getting the error 'expected primary expression before int'. I've fiddled around with it and I just can't figure out what I'm doing wrong.
1 2 3 4 5 6 7 8 9 10 11 12
void computeMaximum(const int data[], int & i)
{
int comp = data[i];
for (int j = 0; j < YEARS; j++)
{
if (comp < data[j])
{
comp = data[j];
i = j;
}
}
}
Nov 14, 2016 at 2:17am UTC
There is nothing wrong with computeMaximum() normally.
Can you show us the declaration of YEARS ?
Nov 14, 2016 at 2:20am UTC
1 2 3 4 5 6 7 8 9 10 11 12 13
extern const double DEATH_RATE = 0.1;
extern const double CONVERSION_RATE = 0.00001;
extern const double GROWTH_RATE = 0.4;
extern const double WOLF_ABILITY = 0.0005;
extern const int CAPACITY = 30000;
extern const int YEARS= 100;
extern const int TABLE_INCREMENT = 10;
Topic archived. No new replies allowed.