diff options
author | Tucker Evans <tucker@tuckerevans.com> | 2020-07-02 17:32:56 -0400 |
---|---|---|
committer | Tucker Evans <tucker@tuckerevans.com> | 2020-07-02 19:41:22 -0400 |
commit | 0d09851c392829a6cbbd047f9a374b5c66eb4c98 (patch) | |
tree | 1bc98adad193667f60f5c918a6deaa244a89fbbc /collections/vector/vector.adoc | |
parent | bc9e78bb7e3fd57a3683e6c8a848b5769d2b21f7 (diff) |
Add push for vector
Diffstat (limited to 'collections/vector/vector.adoc')
-rw-r--r-- | collections/vector/vector.adoc | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/collections/vector/vector.adoc b/collections/vector/vector.adoc index b9101ca..cf001d3 100644 --- a/collections/vector/vector.adoc +++ b/collections/vector/vector.adoc @@ -1,7 +1,7 @@ Vector ====== Tucker Evans -v0.1, 2020-07-01 +v0.2, 2020-07-02 A basic vector, that hold pointers to your data structures. @@ -63,3 +63,18 @@ assert(vec_size(vector) == 0); vec_push_back(vector, NULL); assert(vec_size(vector) == 1); ---- + ++void vec_push(vec *self, void *item)+ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Pushes +item+ into back of +self+. This may cause a resize of the internal buffer. + +Examples +^^^^^^^^ +[source,c] +---- +#include "vector.h" + +vec *vector = vec_new(); +vec_push(vector, NULL); +assert(vec_size(vector) == 1); +---- |