push vector
Definition
void push_vector(vector_t *vector, void *object);
Description
Push a new element at the end of the vector
Parameters
- vector
- Vector in which to push the object.
- object
- Object to add to the vector.
Return Value
void.
Example
#include <stdio.h> #include <libc/string.h> int main(int argc, char *argv[]) { vector_t *vector = create_vector(); push_vector(vector, (void *)10); push_vector(vector, (void *)15); printf("%i\n", get_vector(vector, 1)); destroy_vector(vector); return 0; }
Output:
15