hello,
can someone tell me
what is the difference between sort() (in stl) & qsort(stdlib.h)
thanks in advance.
The most important different is that std::sort() is typesafe whereas
qsort() is not. In other words, when using qsort() a program is given a
pair of void * pointers to rank in its comparison routine; with
std::sort() the program is given two "pointers" (technically,
iterators) of a specific type and asked to rank them. Preserving the
type information in the comparison routine makes mix-ups less likely
when using std::sort(), and the comparison routines themselves are much
easier to match with the type that each knows how to rank.
Greg