>>is it possible to pass two variables back from a float function.. one through 'return variable' & the other through reference
Absolutely yes. If you can't get it to work right then post the code. Here is a common way to do it.
int foo( int& x)
{
x = 123;
return 1;
}
int main()
{
int n = 0;
int k = foo(n);
cout << "n = " << n << " k = " << k << "\n";
return 0;
}
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
in GetHS(), line 10, I assume nRecords is the number of valid entries in the array Scores. If that is true then line 12 is incorrect. Should be this:
for(int a1=0; a1 < nRecords; a1++) because arrays are numbered from 0 up to but not including nRecords. Same is true of line 24.
lint 28: indexb=indexb+a2; << wrong. should be indexb = a2;
lines 43, 44 and 45. Split those lines up something like below and see if that solves the problem, after correcting the above problems.
float x = GetHS(Scores, nRecords, argOne);
cout<<"The highest test score was "<<x<<" by "<<IDs[argOne]<<"."<<endl;
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343