first of all, thx to all experts who help out here
ok I have this array of structs that i used qsort function to sort.
the struct contains a number and a pass #
and I've created an array of structs and loaded every member in the array with a num and pass.
i've used run-to-cursor feature in VS.NET and made sure that data has properly filled in the struct array properly before calling the qsort function.
then I called qsort function to sort it, and qsort filled with 0s and other numbers unrelated to anything I filled in earlier.
everything in the program works as expected up until the program runs that line of code. can somone tell me what i am doing wrong here?
much thanks...
ok I have this array of structs that i used qsort function to sort.
the struct contains a number and a pass #
PHP:
struct progSorted{
int num;
int pass;
};
and I've created an array of structs and loaded every member in the array with a num and pass.
i've used run-to-cursor feature in VS.NET and made sure that data has properly filled in the struct array properly before calling the qsort function.
PHP:
progSorted[0].number = 0
progSorted[1]number = 2
progSorted[2].number = 1
progSorted[3].number = 3
progSorted[4].number = 4
progSorted[5].number = 5
progSorted[6].number = 6
progSorted[7].number = 7
progSorted[8].number =11 // this number belongs to another pass and so on
then I called qsort function to sort it, and qsort filled with 0s and other numbers unrelated to anything I filled in earlier.
PHP:
qsort (&progSorted[sortPosition].number, numToSort, sizeof(int), compare);
//numToSort = 8, sortPosition = 0
everything in the program works as expected up until the program runs that line of code. can somone tell me what i am doing wrong here?
much thanks...