* V2.0 qsort() problem?
@ 1994-10-21 18:11 oberman
1994-10-24 18:36 ` Peter Sherwood
0 siblings, 1 reply; 2+ messages in thread
From: oberman @ 1994-10-21 18:11 UTC (permalink / raw)
I have a problem with the V2.0 qsort() library routine.
qsort(topics, num_topics, sizeof topics[0], strcmp);
All of the arguments look good prior to call, but the sort is seemingly
random. The records are re-ordered, but not in any sequence I can make sense
out of. And worse, some entries are duplicated and others lost!
Is anyone aware of this problem. And is there another version that I might be
able to get that works correctly?
R. Kevin Oberman
Energy Sciences Network (ESnet)
National Energy Research Supercomputer Center (NERSC)
Lawrence Livermore National Laboratory (LLNL)
Internet: koberman@llnl.gov +1 510-422-6955
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: V2.0 qsort() problem?
1994-10-21 18:11 V2.0 qsort() problem? oberman
@ 1994-10-24 18:36 ` Peter Sherwood
0 siblings, 0 replies; 2+ messages in thread
From: Peter Sherwood @ 1994-10-24 18:36 UTC (permalink / raw)
oberman@icaen.llnl.gov wrote:
: I have a problem with the V2.0 qsort() library routine.
: qsort(topics, num_topics, sizeof topics[0], strcmp);
Under v3.0, qsort works OK. I suggest you verify that the type of each
argument in your call matches the qsort prototype, and make a test run
with an array of integers, writing your own key comparison function.
-----------------------------------------------------------------------------
Peter Sherwood
(617) 332-8880 (voice)
(617) 332-1675 (fax)
gbcacm@ccs.neu.edu
-----------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1994-10-24 18:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-10-21 18:11 V2.0 qsort() problem? oberman
1994-10-24 18:36 ` Peter Sherwood
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox