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 would you implement a substr() function that extracts a sub string from a given string?

662


Is c++ the hardest language?

653


What language does google use?

698


program explaining feautures of c++

2053


Write a program using GUI concept for the scheduling algorithms in Operating system like SJF,FCFS etc..

3473






What is iterator c++?

638


What is a terminating character in c++?

880


Define 'std'.

729


What is scope operator in c++?

658


Is c++ a programming language?

693


Where is atoi defined?

660


Can a built-in function be recursive?

684


what is data encapsulation in C++?

705


What is c++ runtime?

743


What is the arrow operator in c++?

651