PrgT_Vector_Compare_Proc
Abstract
Callback: Called during a quicksort to compare two vector elements.
Syntax
PrgT_Vector_Compare_Proc (elem1_ptr, elem2_ptr)
| Argument | Type | Description |
|---|---|---|
elem1_ptr |
void * |
The first element |
elem2_ptr |
void * |
The second element |
Return Type
int
Result of the comparison (see Details).
Header
prg_vector.h
Details
This callback should return one of the following values to indicate the result of the comparison:
- 1—if elem1 should be closer to the vector head than elem2
- 0—if elem1 and elem2 are equal in rank
- -1—if elem2 should be closer to the vector head than elem1
This callback is used by prg_vector_sort().