R
richard
What might cause qsort to crash?
I'm using qsort to sort a few thousand items of a not too complex
structure. Tried it with one data set - worked fine. Tried another
similarly sized data set and the program dies in the midst of the
qsort.
My comparison function doesn't do anything fancy - just some
strnicmp's and =='s.
Any idea what I should look for? It's kinda hard to debug something
that fails in the midst of a library call (a few printf's sprinkled in
the cmp function didn't reveal anything useful).
I don't believe it's an out-of-memory issue.
I'm using MinGW gcc 3.2 on window2k.
I'm using qsort to sort a few thousand items of a not too complex
structure. Tried it with one data set - worked fine. Tried another
similarly sized data set and the program dies in the midst of the
qsort.
My comparison function doesn't do anything fancy - just some
strnicmp's and =='s.
Any idea what I should look for? It's kinda hard to debug something
that fails in the midst of a library call (a few printf's sprinkled in
the cmp function didn't reveal anything useful).
I don't believe it's an out-of-memory issue.
I'm using MinGW gcc 3.2 on window2k.