Results 1 to 3 of 3

Thread: Removing element from dyn.array

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 1999
    Posts
    4

    Post

    What is the simplest way to remove an element from an array?

    So far, the best solution I have found is to use a dynamic array; then, swap the used element, with the last element of the array, and redim the array to one less upper bound (effectively destroying that last, already used element). Is there a more elegant solution?

  2. #2
    Junior Member
    Join Date
    Nov 1999
    Location
    Forsyth, GA, USA
    Posts
    26

    Post

    This is the only way I have done it. But if you want an exercise you could write your on class which could contain this type of coding but do it behind the scenes as you implement methods such as add, insert, delete,...

    ------------------
    Brad

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 1999
    Posts
    4

    Post

    Thanks for the tip!

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