After a vector insert operation, all iterators (pointers) which are pointing
to vector elements are invalid. This is how STL vector semantics are defined.
It is not a replacement for arrays. But of course, if you store references to
objects in a vector and keep the pointers to objects instead of pointers into
a vector, you will not loose anything.

Fenglou Mao wrote:

> Dear all,
>     I think vector of STL in g++ can not substitute traditional array,
> because the address of array elements is fixed, but in 'vector' it is
> not true. Because vector is dynamically extended, it is no use for you to
> save the address of some elements.
>
> Sincerely Yours,
>
> FengLou Mao
> *******************************
> ADD:Mr. FengLou Mao
>     Peking University
>     BeiJing
>     P.R.China
> Tel:86-10-62751490
> Fax:86-10-62751725


Reply via email to