what is the difference between array, arraylist & vector?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shwetashah
    New Member
    • Jan 2010
    • 1

    what is the difference between array, arraylist & vector?

    what is the difference between array, arraylist & vector?
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    An array is a fairly basic type, you have to do or at least consider all the memory management yourself.

    ArrayList (.NET) and vector (STL) are both objects that encapsulate the functionality of an array but provide memory management for the user and some additional functions.

    Generally speaking in an object orientated environment an object implementing an array is better and mmore maintainable than an array, particularly if the array was to be dynamically sized or resized.

    Comment

    Working...