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

Answer Posted / saroj das ,

as we know in C++ the size of array is fixed in compile
time .so the size of array cannot be adjusted at run time
to accommodate changeling program .
but vector can solve this problem allocating memory as
needed. although vector is dynamic

Is This Answer Correct ?    48 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Ask to write virtual base class code?

2149


What is the best free c++ compiler for windows?

588


What is the best way to take screenshots of a window with c++ in windows?

567


Are there interfaces in c++?

558


What is the difference between mutex and binary semaphore?

611






What is anonymous object in c++?

632


Can constructor be static in c++?

641


Explain how an exception handler is defined and invoked in a Program.

582


What is the best c++ book?

710


What is ofstream c++?

587


Why use of template is better than a base class?

642


Should the member functions which are made public in the base class be hidden?

558


What is a tuple c++?

543


What does the ios::ate argument do?

662


What is null and void pointer?

592