Around 06:43am on Wednesday, April 08, 2009 (UK time), Vishva scrawled:

> Dear all, I have a small question
> 
> classA{
>     private:
>     vector<classB*>items;
> 
>     public:
>     vector<classB*> returnVectors();
> }
> 
> main(void)
> {
>     /* anything else */
>     vector<classB*>items2 = returnVectors();
>     /* processing items2 */
> }
> 
> Can any change to item2's members change items' members?
> Or is there another way to do it?

items' members are pointers to classB objects.  So changing a pointer
(address) in items2 will not result in a change to the corrosponding
items' pointer (address).

However changing a classB object pointed to by a member of items2, will
show up if the corrosponging pointer in items is followed.

Is this what you were asking?  :-)

Steve

-- 
 
(o<     www.stevesearle.com
//\     Powered by Fedora
V_/_    No MS products were used in the creation of this message

 14:01:03 up 2 days,  1:23,  1 user,  load average: 0.14, 0.26, 0.20

Reply via email to