Top "Stdvector" questions

std::vector is a contiguous sequence container in the C++ standard library.

C++ valarray vs. vector

I like vectors a lot. They're nifty and fast. But I know this thing called a valarray exists. Why would …

c++ stl stdvector c++-standard-library valarray
std::vector as a template function argument

I want to make a class method that takes a std::vector reference as an argument and I want to …

c++ templates stdvector
std::vector<std::string> to char* array

I have a std::vector<std::string> that I need to use for a C function's argument that …

c++ c stl stdvector
Pushing unique data into vector

I have the following data: FolioA Name1 100 FolioA Name2 110 FolioA Name3 100 FolioB Name1 100 FolioB Name3 106 FolioC Name1 108 FolioC Name2 102 FolioC …

c++ insert unique stdvector
Reading and writing a std::vector into a file correctly

That is the point. How to write and read binary files with std::vector inside them? I was thinking something …

c++ file-io stl iostream stdvector
VHDL initialize vector (the length is not a multiple of 4) in hex

For example, I have a vector which length is 10. How can I initialize it in hex. (The synthesize tool complains …

initialization vhdl stdvector
Set std::vector<int> to a range

What's the best way for setting an std::vector<int> to a range, e.g. all numbers between 3 …

c++ c++11 stl stdvector iota
C++ One std::vector containing template class of multiple types

I need to store multiple types of a template class in a single vector. Eg, for: template <typename T&…

c++ templates stdvector
Can i push an array of int to a C++ vector?

Is there any problem with my code ? std::vector<int[2]> weights; int weight[2] = {1,2}; weights.push_back(weight); It …

c++ stdvector
Remove first N elements from a std::vector

I can't seem to think of a reliable way (that also compacts memory) to remove the first N elements from …

c++ stdvector