× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Dane Cox wrote:
Thanks Hans.  This works better, but it still isn't quite right.  It
looks as if once it hits the first element that is 'to be moved'...in
this case it is the second row in the ds array...then it starts doing
strange things again.
...

Darn! This had me stumped. Actually, I read this trick somewhere and I thought it was pretty cute. But it now appears to suffer from a flaw. It would appear you can't really compare pointers for inequality in the qsort() compare function since you might not actually be pointing to an element *within* the array.


On the other hand, you could still use this trick if you added an "index" field to the structure, and used that as the secondary key for the compare.

Cheers! Hans


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.