What is the size of a vector?



What is the size of a vector?..

Answer / Abhay Murari

The size of a vector in C++ refers to its capacity (the maximum number of elements it can currently hold) or its size (the number of elements currently stored). By default, when you create a vector without specifying the initial size, it starts with a small buffer and automatically grows as more elements are added. The specific values depend on the implementation of the C++ Standard Library.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

Do inline functions improve performance?

1 Answers  


string somestring ; Which of the following choices will convert a standard C++ string object "somestring" to a C string? a) Copy.somestring () ; b) somestring.c_str () c) &somestring [1] d) std::cstring (somestring) e) (char *) somestring

1 Answers   Quark,


Can I create my own functions in c++?

1 Answers  


Explain the isa and hasa class relationships.

1 Answers  


What do you mean by funtion prototype?

1 Answers  


Is c++ a difficult language?

1 Answers  


What can I use instead of namespace std?

1 Answers  


What are inline functions?

3 Answers   Fidelity, Verizon,


Differentiate between an external iterator and an internal iterator? What is the advantage of an external iterator.

1 Answers  


By using c++ with an example describe linked list?

1 Answers  


What is a dangling pointer in c++?

1 Answers  


What are function poinetrs? where are they used?

1 Answers   CTS,


Categories