🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.os.os2.programmer.misc
1 messages
1 total messages Started by Keith Bennett Fri, 01 Dec 1995 00:00
Qsort: Member func's? Qsort source code?
#175
Author: Keith Bennett
Date: Fri, 01 Dec 1995 00:00
30 lines
1870 bytes
I have an application with several classes containing static compare
functions whose addresses I would like to pass to qsort.  When I
brought this issue up before a year or two ago, I was using C/Set and
there was no way to pass the address of a member function (with
System linkage, I think?) to qsort(), who was expecting function of
Optlink linkage.

Now I am using Visual Age C++ and was wondering if there is a new way
around this problem.  I know I can create a nonmember friend
function, but doing so would require modifying about 50 files, and I
was looking for a less painful solution.  (I know there may not be
any.)

Personally, I wouldn't mind making these modifications, but my client
would prefer a method more awkward, but requiring changes to fewer
files.

Currently we're using our own function taking the same parameters as
qsort, but implementing a simpler but slower algorithm.  Perhaps we
should just find some qsort source code and drop it in there?  Any 
suggestions on where to find such a thing?

Thanks.
- Keith

-- 
--------------------------------------------------------------------------
Keith Bennett                             Bennett Business Solutions, Inc.
Silver Spring, MD USA                     OS/2 & DOS Software Development
kbennett@cpcug.org                        (301) 871-7696
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads