Yes, and that should be fixed, but that's not going to cause any real
problems in the behavior of qsort(). (Also, the casts aren't
necessary.) As Harald pointed out, both versions appear to be
equivalent.

Also, the OP merely told us that version 2 "did not work". That's not
enough information. *How* did it not work?

--
Keith Thompson (The_Other_Keith) <>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"

Since there are no significant differences between the two and neither
has an obvious error, you need to provide us the calling function and
the data you used to test. It would also be good if you told us in
what way version 2 did not work.

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!