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

Explain the different access specifiers for the class member in c++.

733


Explain virtual class and friend class.

773


Does std endl flush?

765


What is a constructor in c++ with example?

794


What is the latest c++ standard?

866






Do class declarations end with a semicolon?

759


What is a .lib file in c++?

739


Do class declarations end with a semicolon? Do class method definitions?

841


What is stream and its types in c++?

742


What is isdigit c++?

811


What does it mean to declare a member variable as static?

791


What is the use of function pointer?

740


Explain queue. How it can be implemented?

866


Explain differences between new() and delete()?

807


Write about the members that a derived class can add?

746