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 are the benefits of oop in c++?
What is command line arguments in C++? What are its uses? Where we have to use this?
What is virtual base class uses?
What is the benefit of encapsulation?
Does c++ have a hash table?
Where is atoi defined?
What are protected members in c++?
How does a C++ structure differ from a C++ class?
What do you mean by function pointer?
How would you find out if a linked-list is a cycle or not?
What is struct c++?
Can notepad ++ run c++?
What is microsoft c++ redistributable 2013?
What are associate containers?
What is a volatile variable in c++?