What is the Difference between "vector" and "array"?
Answer Posted / mms zubeir
First, a vector is a template class but not the array is.
So obviously there are members to access the elements of
the vector like, range checking, iterators,
insertion/deletion, predicates, etc.
Since it is a template class, the same implementation can
be used for any type including pointers, objects/user
defined types.
Second, as said by others, vector automatically grow as we
invoke push_back(), we can reserve additional space for
elements, etc.
| Is This Answer Correct ? | 18 Yes | 12 No |
Post New Answer View All Answers
What is buffering in c++?
Is c++ low level?
How is computer programming useful in real life?
What are shallow and deep copies?
Which is not an ANSII C++ function a) sin() b) tmpnam() c) kbhit()
Can c++ be faster than c?
What is singleton class in c++?
If dog is a friend of boy, is boy a friend of dog?
Why we use #include conio h in c++?
Explain the difference between realloc() and free() in c++?
Is c++ vector dynamic?
Explain what happens when a pointer is deleted twice?
Explain the differences between list x; & list x();.
What is data structure in c++?
What kind of problems can be solved by a namespace?