Top "Vector" questions

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

Why is it OK to return a 'vector' from a function?

Please consider this code. I have seen this type of code several times. words is a local vector. How is …

c++ vector stl scope standard-library
std::vector versus std::array in C++

What are the difference between a std::vector and an std::array in C++? When should one be preferred over …

c++ arrays vector
Vector erase iterator

I have this code: int main() { vector<int> res; res.push_back(1); vector<int>::iterator it = …

c++ vector iterator
Correct way to work with vector of arrays

Could someone tell what is the correct way to work with a vector of arrays? I declared a vector of …

c++ arrays vector stdvector
How to turn a vector into a matrix in R?

I have a vector with 49 numeric values. I want to have a 7x7 numeric matrix instead. Is there some sort …

r vector matrix
Convert Mat to Array/Vector in OpenCV

I am novice in OpenCV. Recently, I have troubles finding OpenCV functions to convert from Mat to Array. I researched …

c++ arrays opencv vector synthesis
How do I print the elements of a C++ vector in GDB?

I want to examine the contents of a std::vector in GDB, how do I do it? Let's say it's …

c++ debugging stl vector gdb
How do I pass multiple ints into a vector at once?

Currently when I have to use vector.push_back() multiple times. The code I'm currently using is std::vector<…

c++ c++11 vector push-back
Displaying a vector of strings in C++

I'm sorry if this is a repeat question but I already tried to search for an answer and came up …

c++ vector push-back
Extract every nth element of a vector

I would like to create a vector in which each element is the i+6th element of another vector. For …

r vector