diff options
Diffstat (limited to 'collections/vector/vector.c')
-rw-r--r-- | collections/vector/vector.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/collections/vector/vector.c b/collections/vector/vector.c index 9d895d5..936c0c8 100644 --- a/collections/vector/vector.c +++ b/collections/vector/vector.c @@ -86,3 +86,13 @@ int index; return root->base[index]; } + +void* vec_pop(root) +vec *root; +{ + if (!root || root->end == 0) { + return NULL; + } + + return root->base[--root->end]; +} |