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

Answer Posted / vivek

in vector space is not fixed,but in array space is fixed
second vector has memory allocation is dynamic which is
unsuitable at execution time but in array memory allocation
is continuously
array contain same datatype it is not in vector
array has compatibility to use 2d,3d arrayalso

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is const in c++?

600


What does ctime() do?

620


What is protected inheritance?

602


How many different levels of pointers are there?

660


Define linked lists with the help of an example.

558






What is the best c++ book for beginners?

578


Describe the setting up of my member functions to avoid overriding by the derived class?

616


What is the exit function in c++?

545


Why do we use vector in c++?

604


Explain rethrowing exceptions with an example?

612


Which is the best c++ compiler for beginners?

566


Which of the following is not a valid declaration for main() a) int main() b) int main(int argc, char *argv[]) c) They both work

610


Can non graphic characters be used and processed in C++?

704


Why do we need c++?

599


What is the use of "new" operator?

664