What is the Difference between "vector" and "array"?

Answer Posted / vivek

in vector space is not fixed,but in array space is fixed
second vector has memory allocation is dynamic which is
unsuitable at execution time but in array memory allocation
is continuously
array contain same datatype it is not in vector
array has compatibility to use 2d,3d arrayalso

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If dog is a friend of boy and boy is a friend of house, is dog a friend of house?

655


What are inline functions? What is the syntax for defining an inline function?

668


Is empty stack c++?

612


When should I use unitbuf flag?

683


In which situation the program terminates before reaching the breakpoint set by the user at the beginning of the mainq method?

691






How can you say that a template is better than a base class?

678


Can I learn c++ as my first language?

742


Is java a c++?

656


What is the need of a destructor? Explain with the help of an example.

663


Which of the following is evaluated first: a) && b) || c) !

1939


Does a derived class inherit or doesn't inherit?

718


How do you print a string on the printer?

667


How do you invoke a base member function from a derived class in which you’ve overridden that function?

675


Explain the term memory alignment?

789


the maximum length of a character constant can be a) 2 b) 1 c) 8

716