vector< > uses contiguous memory to store its elements. vector automatically grabs a chunk of memory(say 256 Kbytes) and puts all the data into this memory.When you keep adding data, you will run out of the 256 bytes.So vector gets another 512 Kbytes of contiguous memory and copies the data from its first 256 Kbytes and adds the new data after that..Eventually the 512 Kbytes will also be exhausted and there will be one more allocation and a copy.
All these can be avoided if you know the approximate size of the vector you need.Reserve your vector with the memory it needs, so that it will not need any allocation or copy till the reserved meory is used up. So you almost get the efficiency of the 'C' style array but still have the flexibility to add more elements as needed.