Geometric sort using Visual C++ ...?

Please check out the commented image at

http://www.flickr.com/photos/45608711@N07/43571615...

to answer my question.

Update:

#include <windows.h>

const POINT globalPointArray[] ={

{rand() % 800 , rand() % 600},

{rand() % 800 , rand() % 600},

{rand() % 800 , rand() % 600},

{rand() % 800 , rand() % 600},

{rand() % 800 , rand() % 600},

{rand() % 800 , rand() % 600},

{rand() % 800 , rand() % 600},

};

// this would be a function call to the Polygon function!!!!

void fct(HDC hdc) {

Polygon(hdc, globalPointArray, 7);

}

Update 2:

static int compare(const void *a, const void *b)

{

POINT *ptA = (POINT *)a,

*ptB = (POINT *)b;

return ptA->x - ptB->x;

}

This is the compare function I am currently using for the quicksort. As u can see, the sort order is by x coordinates.

qsort(globalPointArray, iCounter, sizeof(POINT), compare);

Still have questions? Get answers by asking now.