| | |
How sort a Dynamic Array?
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
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);
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.
Here is how a'm calling it: arrSort (arrayOfList, listSize);
Declaration in Public:
void arrSort(int*, int);
C++ Syntax (Toggle Plain Text)
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.
Last edited by kako13; Jan 20th, 2008 at 10:06 pm.
Hi, if I'm right my array is int* arrayName, while the algorithm is for sort an array of type int* arrayName[]? I'm a little confused with that, then I don't be will be able to sort the dynamic array with that algorithm?
Thanks...
Thanks...
Last edited by kako13; Jan 21st, 2008 at 2:14 am.
![]() |
Similar Threads
- Sort multidimensional array on more than one column? (ASP)
- dynamic array (C++)
- Sort a dynamic array of structs (Visual Basic 4 / 5 / 6)
- Sorting 2D Dynamic array of integers , Snake Style (C)
Other Threads in the C++ Forum
- Previous Thread: Help on function pointers
- Next Thread: ODBC C++ Help needed
| Thread Tools | Search this Thread |
api array based beginner binary bitmap c++ c/c++ calculator char char* class code coding compile compiler console conversion count database delete deploy developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int java lib linkedlist linker list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference rpg sorting string strings temperature template test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






