vt_append 3 | 2016-02-28 | genvector manual |
---|
vt_append - append an element to the vector
int vt_append(vt_t *vect, vt_elem_t elem)
vt_append enlarges the vector, and copies the content of elem effectively appending it at the end of the vector. The actual size of the vector (the used field) is increased by 1. If the vector has an user defined copy function, it is used for the copy - the destination is uninitialized and is not constructed before the call.Note: vt_t and the vt_ prefix are type-dependant, see vt_t(7).
Arguments:
vect A vector already initialized using vt_init. elem The element to add. NOTE: elem is NOT passed as a reference; when elem is a struct, consider using vt_append_len() instead.
Returns 0 on success or -1 on error. Error conditions include memory allocation or user supplied elem copy function failure.
vt_append 3 | 2016-02-28 | genvector manual |
---|