Generally always prefer using
std::vector since the
destruction will be automatic once the vector goes out scope and
the allocated memory will be placed neatly on the heap and all the
memory will be handled for you.
std::vector gives you
everything you get in an array and even a guarantee that the
elements will be contiguously stored in memory (except for
In the case of
std::vector you have to be careful
since code like this will break:
bool *pB = &vb;
if( *(pB+1) )
std::vector doesn't store contiguous
bools. This is an exception in the standard that is
fixed in C++11.