Top "Vector" questions

A vector is a single-dimensional array: it contains components that can be accessed using an integral index.

C++ Erase vector element by value rather than by position?

vector<int> myVector; and lets say the values in the vector are this (in this order): 5 9 2 8 0 7 If I …

c++ vector stl erase erase-remove-idiom
How to sum up elements of a C++ vector?

What are the good ways of finding the sum of all the elements in a std::vector? Suppose I have …

c++ stl vector
How can I get the max (or min) value in a vector?

How can I get the max (or min) value in a vector in C++? I have seen a few solutions …

c++ vector max min
vector vs. list in STL

I noticed in Effective STL that vector is the type of sequence that should be used by default. What's does …

c++ list vector stl
C++ for each, pulling from vector elements

I am trying to do a foreach on a vector of attacks, each attack has a unique ID say, 1-3. …

c++ for-loop vector each
Vector of structs initialization

I want know how I can add values to my vector of structs using the push_back method struct subject { …

c++ vector struct push-back
How to pass a vector to a function?

I'm trying to send a vector as an argument to a function and i can't figure out how to make …

c++ function vector
How to create an empty R vector to add new items

I want to use R in Python, as provided by the module Rpy2. I notice that R has very convenient [] …

python r vector rpy2
Vector of Vectors to create matrix

I am trying to take in an input for the dimensions of a 2D matrix. And then use user input …

c++ vector matrix
What are the differences between ArrayList and Vector?

What are the differences between the two data structures ArrayList and Vector, and where should you use each of them?

java vector arraylist