does anyone know of a good c vector library?
are any included with glibc?
does anyone know of a good c vector library?
are any included with glibc?
I'm not a huge fan of vectors. But when I absolutely need them I would go with the c++ stl vector class. I know you said c but this this really sounds like a job for c++.
well, i need to be able to remove pointers easily from various locations in a collection. i also need it to be indexed.
i suppose i could do this with a linked list..
..or can i? i can't get a reference (easily) to the pointer that points to the link i want to remove.
bi-directional linked list maybe?
>well, i need to be able to remove pointers easily from various locations in a collection.
You can do this with a vector, but it's not practical. A linked list would be the better choice if you intend to do many removal operations. Of course, you trade random access for ease of deletion, you need to determine which is more important. If you need both then a tree structure or skip list would be more efficient for both operations, but considerably more complicated as well.
-Prelude
My best code is written with the delete key.
>well, i need to be able to remove pointers easily from various locations in a collection. i also need it to be indexed.
If you mean you need to be able to remove nodes from a list, then you could consider using a linked list. For easy traveling through the list a bi-directional linked list would be useful.
>i can't get a reference (easily) to the pointer that points to the link i want to remove.
A linked list is easily traversible and in the nodes you could store an index which you can use to find the node to be removed.