prg_vector_set()
Abstract
Places an element into a vector at a specified position, replacing contents already at that position.
Syntax
prg_vector_set (vector_ptr, element_ptr, pos_index)
| Argument | Type | Description |
|---|---|---|
vector_ptr |
PrgT_Vector * |
vector of interest |
element_ptr |
void * |
element to be placed in the vector |
pos_index |
unsigned long |
position in the vector (zero-indexed) |
Return Type
void *
Element previously stored in the specified location
Header
prg_vector.h
Details
The position must be within the bounds of the vector as it currently exists. In other words, the new element cannot be added beyond the end of the vector. The element that is currently being replaced is returned (typically, it is processed in some way or destroyed) by this function.
Position indices are zero-indexed. In other words, the first element has position index 0, the second is 1, and so on.