What is the Difference between "vector" and "array"?

Answer Posted / namitha

Vectors are a kind of sequence containers. As such, their
elements are ordered following a strict linear sequence.

Vector containers are implemented as dynamic arrays; Just as
regular arrays, vector containers have their elements stored
in contiguous storage locations, which means that their
elements can be accessed not only using iterators but also
using offsets on regular pointers to elements.


Arrays is a sequence of similar data type.

Is This Answer Correct ?    11 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is c++ hiding?

723


What is the use of setprecision in c++?

618


What is math h in c++?

689


What is prototype for that c string function?

772


How do you decide which integer type to use?

661






What do you mean by static variables?

687


What is singleton pattern in c++?

633


Do you know what are the new features that iso/ansi c++ has added to original c++ specifications?

644


How is new() different from malloc()?

737


What is rvalue?

781


What is a null object in c++?

739


What does namespace mean in c++?

723


Is dev c++ free?

694


Explain the use of virtual destructor?

708


How a modifier is similar to mutator?

739