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

What are static and dynamic type checking?

826


Can a list of string be stored within a two dimensional array?

777


What is function declaration in c++ with example?

748


What are signs of manipulation?

837


What is scope operator in c++?

830


What is format for defining a structure?

827


Why isn't sizeof for a struct equal to the sum of sizeof of each member?

764


Explain shallow copy?

810


Specify some guidelines that should be followed while overloading operators?

869


Explain what is class definition in c++ ?

818


How is c++ used in the real world?

790


Explain the difference between struct and class in terms of access modifier.

971


Define Virtual function in C++.

852


what are the iterator and generic algorithms.

1695


Can comments be longer than one line?

824