Results 1 to 9 of 9

Thread: vectors

  1. #1

    Thread Starter
    Hyperactive Member Amon Ra's Avatar
    Join Date
    Feb 2001
    Location
    In some cave on Uranus...
    Posts
    500

    vectors

    i know how to add an element to a vector, how to remove the back, but how do i remove let's say the one in the middle? since the elements are going to be objects. i want to remove the one that has the hWnd == wnd.Hwnd, and remove it, how would i do that? remove a specific element?
    Amon Ra
    The Power of Learning.

  2. #2

    Thread Starter
    Hyperactive Member Amon Ra's Avatar
    Join Date
    Feb 2001
    Location
    In some cave on Uranus...
    Posts
    500
    even better i anone could give me the name of a good tutorialthanks in advance..
    Amon Ra
    The Power of Learning.

  3. #3

    Thread Starter
    Hyperactive Member Amon Ra's Avatar
    Join Date
    Feb 2001
    Location
    In some cave on Uranus...
    Posts
    500
    nevermind gee..figured it out
    Amon Ra
    The Power of Learning.

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    You can delete threads by editing the first post, checking the delete checkbox and then pressing the delete button.
    I recommend that you delete threads where you found out the answer yourself before anyone could answer. If someone answered, leave the thread, because someone else might actually search the forum.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  5. #5
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    And leaving them lets me wander in with random tidbits...

    If you're going to be regularly removing an item from the middle, it's better to use a list rather than an array.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  6. #6
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Or maybe a set, because this is sorted and would speed up your search for the right HWND.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  7. #7

    Thread Starter
    Hyperactive Member Amon Ra's Avatar
    Join Date
    Feb 2001
    Location
    In some cave on Uranus...
    Posts
    500
    well, CornedBee, the thing is that i dont really know how to create sets, binary tree or any algorithms..i know how to create a
    a simple linked list, but that's it..mayby if it's not out of your way, could you lead me to a tutorial or something? thanks..
    Amon Ra
    The Power of Learning.

  8. #8
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    The C++ STL includes a container called set. I don't know kow to use it, parksie may know a reference page.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  9. #9
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width