About 174,000 results
Open links in new tab
  1. Arrays vs Vectors: Introductory Similarities and Differences

    Feb 26, 2013 · What are the differences between an array and a vector in C++? An example of the differences might be included libraries, symbolism, abilities, etc. Array Arrays contain a …

  2. std::vector versus std::array in C++ - Stack Overflow

    Dec 12, 2010 · std::vector is a template class that encapsulate a dynamic array 1, stored in the heap, that grows and shrinks automatically if elements are added or removed. It provides all …

  3. Difference between Array and Vector - Stack Overflow

    Apr 12, 2020 · The difference is that Vector is a 1-dimensional Array, so when you write e.g. Vector{Int} it is a shorthand to Array{Int, 1}:

  4. c++ - What is the difference between std::array and std::vector?

    What is the difference between std::array and std::vector? When do you use one over other? I have always used and considered std:vector as an C++ way of using C arrays, so what is the …

  5. C++ std::vector vs array in the real world - Stack Overflow

    A: Almost always [use a vector instead of an array]. Vectors are efficient and flexible. They do require a little more memory than arrays, but this tradeoff is almost always worth the benefits. …

  6. When to use vectors and when to use arrays in C++?

    Jun 2, 2012 · The main difference between a vector and an array, in a C++ sense, is that vectors do automatic dynamic memory management, whereas arrays are fixed.

  7. What is the difference between an array and a vector?

    An array of numbers is a means to represent a vector, given a basis of the vector space. Mental laziness often causes us to forget the distinction between the object designated en the entity …

  8. c++ - array of vectors or vector of arrays? - Stack Overflow

    Feb 19, 2016 · So does this create an array of type vector or does this create a vector of arrays? The BFS code seems to traverse through a list of values present at each instance of adj [i], …

  9. c++ - array vs vector vs list - Stack Overflow

    Oct 30, 2014 · stl vector - insert/delete takes linear time due to shifting; update takes constant time; no space is used for pointers; accessing an item is slower than an array since it is a call …

  10. Using arrays or std::vectors in C++, what's the performance gap?

    Dec 20, 2008 · C++ Array vs Vector performance test explanation contradicts the conclusions from "Comparison of assembly code generated for basic indexing, dereferencing, and …