This example creates an inline array of integers, and demonstrates the difference between eina_inarray_insert and eina_inarray_sort, and eina_inarray_search and eina_inarray_search_sort. Eina inline array usage.
We start with some variable declarations and eina initialization:
We then create the array much like we did on Eina inline array usage :
We then add an element using eina_inarray_insert and print. Then remove that element and add it again using eina_inarray_insert_sorted and print. This shows the 2 different positions the element gets added. Then search for an element in the unsorted array using eina_inarray_search, then sorts the array and then searches the same element using eina_inarray_search_sorted.
The source for this example: eina_inarray_03.c