The elements of an array (including CArray) can be accessed randomly with an
index. That is very fast. A list (including CList) cannot be accessed randomly
at all - it is necessary to scan through it sequentially to access an element.
Use arrays for fast random access, use lists for fast insertion or removal of
elements.
--
Scott McPhillips [VC++ MVP]
Right. Each element of a list contains a pointer to the next item
(single list) or to both the previous and next items (double-linked).
If you need the fiftieth element, you have to traverse the previous
forty-nine to get it. With a table you can simply calculate the
address of the fiftieth element and go directly there.
--
Tim Slattery
Slatt...@bls.gov