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 is iostream::eof inside a loop condition considered wrong?

812


Program to check whether a word is a sub-string or not of a string typed

1790


How would you implement a substr() function that extracts a sub string from a given string?

769


What is the difference between function overloading and operator overloading?

758


How to allocate memory dynamically for a reference?

773


What is constructor c++?

860


Why can’t you call invariants() as the first line of your constructor?

761


What is the first name of c++?

760


What is basic if statement syntax?

766


Which software is best for c++ programming?

773


what is Loop function? What are different types of Loops?

885


Describe linkages and types of linkages?

767


What it is and how it might be called (2 methods).

840


What is dynamic and static typing?

878


What is the use of 'using' declaration in c++?

840