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

Answer Posted / vishwa

vector is also an array but the size of a vector can change
dynamically where in array its fixed.

we can create some reserve space in vector where in array we
cannot.

Is This Answer Correct ?    136 Yes 17 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we use string in c++?

509


Why should we use null or zero in a program?

600


If we want that any wildcard characters in the command line arguments should be appropriately expanded, are we required to make any special provision? If yes, which?

1003


What is the size of a vector?

575


Define pre-condition and post-condition to a member function in c++?

661






Define stacks. Provide an example where they are useful.

575


What is the type of 'this' pointer?

598


Explain the differences between private, public and protected and give examples.

564


What is problem with overriding functions?

606


What information can an exception contain?

667


What are the defining traits of an object-oriented language?

692


Is swift better than c++?

538


Is it possible to provide default values while overloading a binary operator?

764


What are the types of container classes?

616


Is c++ low level?

576