When using the standard allocator, you can be sure that the allocated memory is continuous when using std :: vector. In other words, foo [n + 1] is the next element in the sequence after foo [n]. But std :: vector is not an array like
int* blah = new int[100];
not an array. But
int blah[100];
created on the stack is an array. Pointers to allocated memory and arrays just use semantics. They are not equal by standard, so do not confuse them.
Mads elvheim
source
share