int getFCSold(int[], int); //To get the number of Fist Class seats already sold.
//***********************************************************
// getFCSold *
// To get the number of First Class seats already sold. *
//***********************************************************
int getFCSold(int FCTBL[][4], int SOLD)
{
int fc = 0;
int total = 0;
while (SOLD == 0)
{
for (fc = 0; fc < FCSIZE; fc++;)
total += fc;
}
return total;
}
I get the same error when I add the second set of brackets. I had this same error in my program from last week. I don't understand though, because in my book it shows it this way and states it can be written this way. Maybe I'm too tired to think at this point and it's obvious, but I just don't see it.
When you pass an array to a function the argument for the array should be just the name of the array, not with the brackets.
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
int arrayFunction(int[]);
int main()
{
int array[10];
// no brackets just the name
arrayFunction(array);
return 0;
}
int arrayFunction(int array[])
{
// stuff . . .
}