I cant not figure out whats the problem with my function call. I keep getting these errors.
1 2 3 4 5
prog5.cpp: In function `int main()':
prog5.cpp:48: error: no matching function for call to `IntList::selectionSort(int&)'
IntList.h:25: note: candidates are: void IntList::selectionSort()
IntList.cpp:55: error: prototype for `void IntList::selectionSort(IntList::ListNode*)' does not match any in class `IntList'
IntList.h:25: error: candidate is: void IntList::selectionSort()
You declared it as void variables and you are trying to pass it variable n. You have it set up as a function with a variable in the description but void in your declaration. Line 25 is your error, the parenthesis should not be empty.
you should declare void selectionSort(ListNode*) or void selectionSort(int*)
in you .h file i think.
also since it seems at first glance that ListNode* is not an int*,then you should declare both functions
in your class.
48 myList.selectionSort(*n) doesn't mean anything,you should pass a pointer to a node,
try 48 myList.selectionSort(&n) if n is a node.if n is a pointer to a node just pass n to the function.
n is just an int that i declared to pass integers from a function to another. I have other functions that i use n but this is the only one i need to use node pointers in.