vectors

I have a set of objects, that need to do something all at once, so I put them all into a vector.However, whenever I try to do something to a specific variable using its original name, nothing happens. When is change the state using the original name, and then access using the vector, the values are different. Why is this?
does the vector contain copies of your objects , or pointers to them? if you say

myVector[i] = someObject

you actually create a copy.
closed account (zb0S216C)
When a new element is pushed into a vector, the vector obtains a copy of the referenced object. The pushed object is not tied to the original object, which means that any alterations to the pushed object doesn't directly or indirectly alter the original object, hence the reason why the original object remains unaltered.

Wazzak
so how do i tie it to the orig?
closed account (zb0S216C)
Either by pointers or references. References must be initialized with an object.

Wazzak
Topic archived. No new replies allowed.