any one cloud help me with this small problem

i just start today to do my Assignment: i have these problems on my program
any on can fix it to me

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

# include <iostream>
using namespace std;
int maxPosition(int intList[], int last)
{
	int max=0;
	for(int i=1 ; i<=last ; i++)
		if(max<intList[i])
		{
			max=intList[i];
			int location=i;
		
		return location;
		}
}
void Slectionsort(int intList[],int last)
{
	for(int i=last ; i>0 ; i++)
	{
		int maxindex;
		int maxPostion;
		maxindex=maxPostion(intList,i);
		int temp=intList[maxindex];
		intList[maxindex]=intList[i];
		intList[i]=temp;
	}
}
int main()
{
	int x[5]={40,20,30,50,10};
	int last=4;
	Slectionsort(x,last);
	for(int i=0 ; i<last+1 ; i++)
		cout << x[i] << endl;
	cout << endl;
	return 0;
}

error C2064: term does not evaluate to a function taking 2 arguments

Last edited on
There should be a line number associated with the error. Do you know what the offending line of code is?
Line 22 is why you have that error. Looks like it's not the only issue with the code though. I'll let you try to work it out from this point though.


maxindex=maxPostion(intList,i);

maxPosition is misspelled
Topic archived. No new replies allowed.