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