What are the vectors in C++?

devquora
devquora

Posted On: Feb 22, 2018

 

Vectors are a kind of data structure sequence containers, which represent arrays but can change in size. Just like arrays, vectors make use of contiguous storage locations for their elements, which implies that the elements of vectors can also be accessed using offsets on regular pointers to its elements, and just as efficiently as in arrays. However, unlike arrays, their size can change dynamically, with their storage being handled automatically by the container.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    C++ Interview Questions

    Explain what is OOP?

    Object-oriented programming (OOP) is a type of computer programming, also more commonly known as software design, in wh..

    C++ Interview Questions

    What is the difference between #import and #include in C++?

    The statement #include is used in C++ to include the source file or import the header files containing definitions of f..

    C++ Interview Questions

    What is ‘this’ pointer?

    The ‘this’ pointer is passed as a hidden argument to all the non-static member method calls and is available as a l..