Click here to Skip to main content
15,899,126 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralSort algorithm Pin
John Cruz14-May-02 12:45
John Cruz14-May-02 12:45 
GeneralRe: Sort algorithm Pin
Christian Graus14-May-02 12:51
protectorChristian Graus14-May-02 12:51 
GeneralRe: Sort algorithm Pin
John Cruz14-May-02 13:00
John Cruz14-May-02 13:00 
GeneralRe: Sort algorithm Pin
Christian Graus14-May-02 13:02
protectorChristian Graus14-May-02 13:02 
GeneralRe: Sort algorithm Pin
John Cruz14-May-02 13:15
John Cruz14-May-02 13:15 
GeneralRe: Sort algorithm Pin
Christian Graus14-May-02 13:48
protectorChristian Graus14-May-02 13:48 
GeneralRe: Sort algorithm Pin
John Cruz14-May-02 14:23
John Cruz14-May-02 14:23 
GeneralRe: Sort algorithm Pin
Christian Graus14-May-02 15:02
protectorChristian Graus14-May-02 15:02 
Sorry - it was obvious all along. You need to pass in &sprites[0] and &sprites[9]. I'm not sure this will work - it expects begin and end, and end is one PAST the last item in the array, so sprites[9] may not be sorted - therefore I would pass in &sprites[0] + 10 as the second argument.

It could also be cleaned up in other ways - you could use mem_fun_ref and have the sorting function be a member of your struct. Check out my article on functors for more info.

Christian

The tragedy of cyberspace - that so much can travel so far, and yet mean so little.

And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
GeneralRe: Sort algorithm Pin
John Cruz14-May-02 16:32
John Cruz14-May-02 16:32 
GeneralRe: Sort algorithm Pin
Christian Graus14-May-02 17:44
protectorChristian Graus14-May-02 17:44 
GeneralRe: Sort algorithm Pin
Jon Hulatt15-May-02 0:09
Jon Hulatt15-May-02 0:09 
Generalincreasing maximum threads per process Pin
scott sanders14-May-02 12:21
scott sanders14-May-02 12:21 
GeneralRe: increasing maximum threads per process Pin
Anders Molin14-May-02 12:38
professionalAnders Molin14-May-02 12:38 
GeneralRe: increasing maximum threads per process Pin
Tim Smith14-May-02 12:44
Tim Smith14-May-02 12:44 
GeneralRe: increasing maximum threads per process Pin
Andrew Hafen14-May-02 13:07
Andrew Hafen14-May-02 13:07 
GeneralPredefined control class names Pin
ed987114-May-02 11:30
ed987114-May-02 11:30 
GeneralRe: Predefined control class names Pin
Larry Antram14-May-02 12:00
Larry Antram14-May-02 12:00 
GeneralShowing a larger image in a small PictureBox Pin
14-May-02 11:05
suss14-May-02 11:05 
GeneralRe: Showing a larger image in a small PictureBox Pin
Jason Henderson14-May-02 11:37
Jason Henderson14-May-02 11:37 
Generalstring arrays in vc++ Pin
14-May-02 10:46
suss14-May-02 10:46 
GeneralRe: string arrays in vc++ Pin
valikac14-May-02 11:25
valikac14-May-02 11:25 
GeneralRe: string arrays in vc++ Pin
Ravi Bhavnani14-May-02 17:10
professionalRavi Bhavnani14-May-02 17:10 
GeneralRe: string arrays in vc++ Pin
15-May-02 6:02
suss15-May-02 6:02 
GeneralX and Y Size Pin
14-May-02 10:16
suss14-May-02 10:16 
GeneralRe: X and Y Size Pin
Jack Handy14-May-02 10:44
Jack Handy14-May-02 10:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.