Getting Array data into a Function

Heyo - I'm still pretty new at programming and I've been trying to figure out what I'm doing wrong in calling the low_highScores() function below. Is the problem in my function itself or how I'm calling it? I've tried everything I can think of and all errors point to the various ways I'm trying to call it. Any help would be much appreciated.

The pasted the entire code at http://rafb.net/p/7ZYfQK73.html

void getNineHoles(int NineHoles[]) //Gets stats for 9 holes and displays them
{
for (int i=0; i<9; i++)
{
cout << "Enter stats for 9 holes ";
cin >> NineHoles[i];
}

for (int i=0; i<9; i++)
{
cout << NineHoles[i] << endl;
}

low_highScores(int NineHoles[i]);
return;
}

int low_highScores(int NineHoles[9])
{
//int const MAX = 9;
int lowest;
int highest;
int total; // total for use with average func

for ( int i = 0 ; i < 9 ; i++ ) //find the highest and lowest value in the array
{
if ( lowest < NineHoles[i]) //find the lowest value
{
lowest = NineHoles[i];
}

if ( highest > NineHoles[i]) //find highest value
{
highest = NineHoles[i];
}
total += NineHoles[i];
}

cout << "Your best hole this game was a " << lowest << "." << endl;
cout << "Your worst hole was a " << highest << "." << endl;
//cout << "Your average score for the 9 holes was " << average << "." << endl;

return 0;


Under low_highScores(int NineHoles[i]); get rid of the return - void Functions() don't have a return value.
Thanks much. Oddly enough I wasn't getting errors for that. But I'm still getting errors with:

low_highScores(int NineHoles[i]);

whether I specify NineHoles[9] or otherwise. What am I missing?

'function does not take 0 arguments' - Isn't NineHoles[9] an argument in that case? I'm a bit confused.

Again, thanks for any help.
Try to use low_highScores(NineHoles); your function expects an array[9] while you tried to pass a single int (NineHoles[i]).
Butterkeks - Thanks. That was it.
Topic archived. No new replies allowed.