Hi, I have been searching in google for an algorithm for sort a dynamic array. I must said that the information in the Internet for sort dynamic array is very limited. However, I found bubble sort for dynamic array, but it don't wanna work. It is inside a class definition and I'm calling it from a function inside the same class.
Here is how a'm calling it: arrSort (arrayOfList, listSize);
Declaration in Public:
void arrSort(int*, int);
void file::arrSort(int* pDonate[], int s)
{
bool swap;
int* temp;
do
{
swap = false;
for (int count = 0; count < (s-1); count++)
{
if ((*pDonate[count]) > (*pDonate[count+1]))
{
temp = pDonate[count];
pDonate[count] = pDonate[count+1];
pDonate[count+1] = temp;
}
swap = true;
}
}
while(swap);
}
Here is the error:
C:\Users\xxx\Desktop\file.h prototype for `void file::arrSort(int**, int)' does not match any in class `file'
C:\Users\xxx\Desktop\file.h void file::arrSort(int*, int)
I'm using Dev C++.
Any suggestion will be appreciate.