Original Post
hello, i've come to a point in my project where i need to sort some objects based on their vertical position. im using a vector for the objects, which i'm going to hafta change to a list since i wasnt thinking ahead. but im not sure how to sort using the sort member function. in my book it says i can pass it a comparison function. but it gives no examples and im not clear on the syntax. i also tried using vectors and coverting to a standard array and then use qSort (waste of memory, but i just wanted to try it out) ... i could get that to work either, since the compare function prototype is ... int comp (const void *, const void *) and i coudnlt get it to sort the y variable of my obj class. so i can see the sort in the list class is like this ... void sort(Comp cmpfn); how do i use this function? thanks for any help in advance.