Add a clear function for the vector.
This commit is contained in:
@@ -88,5 +88,11 @@ int vec_foreach(vec* vec, void* data, compare_func compare, foreach_func foreach
|
||||
* @return pointer to the value, or, if the index is out of bounds (or there is nothing there) NULL.
|
||||
*/
|
||||
void* vec_index(vec* vec, int index);
|
||||
/**
|
||||
* Clears the vector, removing all elements from it
|
||||
* but not resizing it down.
|
||||
* @param vec the vector to clear.
|
||||
*/
|
||||
void vec_clear(vec* vec);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user