Just to add to fpsgamer's response and answer your second question not relating to pointers in vectors:
std::vector<object> array;if(true){ object foo; array.push_back(foo)} //foo falls out of scope
When you do the push_back, as fpsgamer explained, a copy of foo is pushed onto the vector. There are now two instances of your object class, foo and the copy in the vector.
When the closing brace is hit, foo is destroyed and its stack space reclaimed. However, this has no effect on the copy of foo in the vector.
Be aware that even just doing a push_back on a vector can cause the vector to need to reallocate memory. At this point, all the current contents of the vector are copy-constructed into the new memory, then the originals are destructed.
This is worth knowing if your objects have non-trivial construction/destruction. It is also why storing pointers or iterators into a vector is generally a bad idea unless you are absolutely sure the vector is not going to reallocate.