good vector library

This is a discussion on good vector library within the C Programming forums, part of the General Programming Boards category; does anyone know of a good c vector library? are any included with glibc?...

  1. #1
    Registered User
    Join Date
    Aug 2002
    Posts
    351

    good vector library

    does anyone know of a good c vector library?

    are any included with glibc?

  2. #2
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    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++.

  3. #3
    Registered User
    Join Date
    Aug 2002
    Posts
    351
    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?

  4. #4
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >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.

  5. #5
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,386
    >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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. In a game Engine...
    By Shamino in forum Game Programming
    Replies: 28
    Last Post: 02-19-2006, 11:30 AM
  2. Good books for learning WIN32 API
    By Junior89 in forum Windows Programming
    Replies: 6
    Last Post: 01-05-2006, 05:38 PM
  3. Good resources for maths and electronics
    By nickname_changed in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 12-22-2004, 04:23 PM
  4. what is good for gaphics in dos
    By datainjector in forum Game Programming
    Replies: 2
    Last Post: 07-15-2002, 04:48 PM
  5. i need links to good windows tuts...
    By Jackmar in forum Windows Programming
    Replies: 3
    Last Post: 05-19-2002, 12:16 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21