3 Answers
3

Vector is a wrapper in a sorts for an array and provides all the features of an array whilst also allowing the array to grow shrink know how big it is and a lot of other useful features. One of the requirements of std vector is that its data is stored in a contiguous fashion like an array. Because of this requirement you can get an array of elements by taking the address of the first element regardless of type.

std::vector <CustomClass*>vectorObject Means that you have a vector of CustomClass Pointers to get an array

CustomClass **Array = &vectorObject[0] Now I have taken the contiguous data segment at offset 0 in the vector and assigned it the a pointer pointer of customclass remember that arrays and pointers are deeply connected in c and c++ I can now access the pointer pointer as if it were an array

+1 for first observation. The last sentence is wrong though, there's no "probably" about it. std::vector is required to use sequential storage, to enable interop with old APIs that accept pointers.
–
Ben VoigtNov 1 '12 at 17:37

@BenVoigt, not saying you're wrong, and intuitively it would make sense, but I don't see a requirement for it at sgi.com/tech/stl/Vector.html. The closest thing I can see is the sequence requirement of elements being arranged in strict linear order, but that's not strong enough.
–
BlindyNov 1 '12 at 17:41

Read the linked question. Also note I wrote about std::vector, which is similar but not identical to the vector collection template in SGI STL. SGI documentation is not the definitive reference, the C++ Standard is.
–
Ben VoigtNov 1 '12 at 18:04

I read that also, it was a proposal for C++11, not part of the current standard as far as I can tell.
–
BlindyNov 1 '12 at 18:12