qsort sorts an array in place through a generic interface: pass the base address, element count, element size, and a function pointer that defines ordering. section 11.4
A safe comparison function
The comparator receives pointers to two elements. Return a negative value when the first precedes the second, zero when they compare equal, and a positive value otherwise. Compare explicitly rather than returning *A - *B, which can overflow for extreme int values.
Because qsort receives the array as void* and loses its element type, size must describe each element correctly and the comparator must interpret that element type consistently. section 11.4

