|
| void | init (Vector *vec, int val) |
| | This function initilaizes the vector and gives it a size of 1 and initializes the first index to 0.
|
| |
| void | delete (Vector *vec) |
| | This function clears the heap memory allocated by the Vector.
|
| |
| void | clear (Vector *vec) |
| | This function clears the contents of the Vector.
|
| |
| int | len (Vector *vec) |
| | This function returns the length the Vector.
|
| |
| void | push (Vector *vec, int val) |
| | This function pushes a value to the end of the Vector.
|
| |
| int | get (Vector *vec, int index) |
| | This function get the item at the specified index of the Vector.
|
| |
| void | set (Vector *vec, int index, int val) |
| | This function sets an item at the specified index of the Vector.
|
| |
| int | next (Vector *vec) |
| | This function gets the next item from the Vector each time it's called.
|
| |
| void * | begin (Vector *vec) |
| | This function returns the pointer to the begining of the Vector.
|
| |
| void | print (Vector *vec) |
| | This function prints the entire Vector as a list.
|
| |
| static void | test () |
| | This function tests the functions used to work with Vectors.
|
| |
| int | main () |
| | Main function.
|
| |
This is a vector implemenation in C.
A vector is an expandable array.
This vector implementation in C comes with some wrapper functions that lets the user work with data without having to worrying about memory.