On Tue, 26 Jan 1999, Martin v. Loewis wrote:
> > 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.
>
> No, you cannot do that. But then, you shouldn't, either. There is
> always a way to achieve the same thing without remembering addresses.
Perhaps you want to tell me to remmember the index of vector element can
trace them, but vector is a sequence, you can erase any element, after
that, the indexes you remmembered can not access the correct object.
And sometimes, pointer is the fastest way to go to another object,
especially in CPU-comsuming program, keep a pointer to another object is
very important.
Sincerely Yours,
FengLou Mao
*******************************
ADD:Mr. FengLou Mao
Peking University
BeiJing
P.R.China
Tel:86-10-62751490
Fax:86-10-62751725