what is the difference between a vector and an array?
An array is always a list in nature, but a vector is template class and same as a dynamic array. The array allows both kinds of access, direct and sequential while Vector only allows sequential access. And this is because the way these data structures are stored in memory.