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

Is multimap sorted c++?

652


daily Routine of father

1013


Tell me can a pure virtual function have an implementation?

661


What is basic if statement syntax?

646


what is a reference variable in C++?

746






What is the difference between new() and malloc()?

708


Define basic type of variable used for a different condition in C++?

757


Where is atoi defined?

655


What does the linker do?

690


Define pre-condition and post-condition to a member function in c++?

760


What is the difference between multiple and multilevel inheritance in c++?

718


Write is a binary search tree? Write an algo and tell complexity?

687


Which bitwise operator is used to check whether a particular bit is on or off?

682


Why is c++ so fast?

623


which operator is used for performing an exponential operation a) > b) ^ c) none

697