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

How do I use turbo c++?

756


What are different types of loops in c++?

879


What do you understand by zombie objects in c++?

856


What is switch case in c++ syntax?

879


Explain the term memory alignment?

947


What does iomanip mean in c++?

924


If there are two catch statements, one for base and one for derived, which should come first?

795


Write about the local class and mention its use?

859


Where is atoi defined?

821


What is the header file for setw?

848


Where are setjmp and longjmp used in c++?

870


Am pass the 10000 records to target in target I will take commit interval 15000 when I was stop the work flow what will happened

1368


Where and why do I have to put the "template" and "typename" keywords?

823


write asingle linked list which read from two list & the do the following 1 sort the prime & nonprime num (prime should be less tn nonprime) 2 each node has a prime num followd by nonprime 3 add a new node into its sutable plce 4 erase the most three duplicated non prime num 5 find the least duplicated prime num

2440


What is ifstream c++?

837