【文件属性】:
文件名称:vector:纯C向量实现
文件大小:9KB
文件格式:ZIP
更新时间:2021-05-15 12:49:30
C
向量
vector是纯C中功能完整,通用且可自定义的可调整大小的数组实现,它几乎支持整个C ++ std::vector API(包括迭代器)。
用法
# include " vector.h "
int main ( int argc, const char * argv[]) {
Vector vector;
int x, y, sum;
/* Choose initial capacity of 10 */
/* Specify the size of the elements you want to store once */
vector_setup (&vector, 10 , sizeof ( int ));
x = 6 , y = 9 ;
vector_push_back (&vector, &x);
vector_insert (&vector, 0 ,
【文件预览】:
vector-master
----vector.h(5KB)
----test()
--------example.c(972B)
--------test.c(2KB)
----vector.c(14KB)
----LICENSE(1KB)
----.gitignore(494B)
----CMakeLists.txt(1015B)
----README.md(2KB)