I seem to be having a small error and I can't figure out for the life of me the issue.
"in function " void selectionsortArray (int*, int):"
"error expected '}' at end of input"
include <iostream>
#include<cstdlib>
using namespace std;
void selectionSortArray(int [], int);
void displayArray(int[], int);
const int SIZE = 5;
int main()
{
int values[SIZE] = {9,2,0,11,5};
cout << "The values before the selection sort is performed are:" << endl;
displayArray(values,SIZE);
selectionSortArray(values,SIZE);
cout << "The values after the selection sort is performed are:" << endl;
displayArray(values,SIZE);
system("pause");
return 0;
}
void displayArray(int array[], int elems)
{
for (int count = 0; count < elems; count++)
cout << array[count] << " ";
cout << endl;
}
void selectionSortArray(int array[], int elems)
{
int seek;
int minCount;
int minValue;
for(seek = 0; seek < (elems-1);seek++)
{
minCount = seek;
minValue = array[seek];
for(int index = seek + 1; index < elems; index++)
{
if(array[index] > minValue)
{
minValue = array[index];
minCount = index;
}
}
array[minCount] = array[seek];
array[seek] = minValue;
}