Answers for "compare function in qsort"

C
0

qsort compare function return type

int comparator(const void* p1, const void* p2);
Return value meaning
<0 The element pointed by p1 goes before the element pointed by p2
0  The element pointed by p1 is equivalent to the element pointed by p2
>0 The element pointed by p1 goes after the element pointed by p2

Source: http://www.cplusplus.com/reference/cstdlib/qsort/
Posted by: Guest on July-26-2021

Code answers related to "C"

Browse Popular Code Answers by Language