VecSort
- Macro
- August 22, 2025
Table of Contents
VecSort
VecSort
Description
Sort given vector with given comparator using quicksort algorithm.
Parameters
Name | Direction | Description |
---|---|---|
v | in,out | Vector to be sorted. |
compare | in | Compare function. Signature and behaviour must be similar to that of ZstrCompare . |
Success
return
Failure
Does not return
Usage example (Cross-references)
- In
Vec.Ops.c:117
:
// Test VecSort function
bool test_vec_sort(void) {
printf("Testing VecSort\n");
// Create a vector of integers
- In
Vec.Ops.c:130
:
// Sort the vector in ascending order
VecSort(&vec, compare_ints_asc);
// Check that the elements are sorted
- In
Vec.Ops.c:140
:
// Sort the vector in descending order
VecSort(&vec, compare_ints_desc);
// Check that the elements are sorted in descending order