cvector · Section 3
cvector_at
NAME
cvector_at - access an element at a specific index
LIBRARY
C Collections (libccollections, -lccollections)
SYNOPSIS
#include <ccollections/cvector.h> void *cvector_at(cvec v, size_t index);
DESCRIPTION
Gives a pointer to the element at the given index, through which the caller can read the element or change it in place.
PARAMETERS
v Vector to access index Zero-based index of the element to access
RETURN VALUE
A pointer to the element at the index on success. NULL when index >= elem_count, and when the vector is empty.
NOTES
O(1). The pointer is valid only until the size of the vector changes. The function asserts when v is NULL.