B
bob
I want to populate a vector<int> with random values. I was on my to
doing this;
using namespace std;
vector<int> v( 10000);
vector<int>::iterator begin = v.begin();
vector<int>::iterator end = v.end();
iota(begin, end, 2);
random_shuffle(begin,end);
but it looks like "iota" is an old legacy thang not really in the stl.
What's the easiest/quickest way to fill a vector up with random values.
thanks very much.
G
doing this;
using namespace std;
vector<int> v( 10000);
vector<int>::iterator begin = v.begin();
vector<int>::iterator end = v.end();
iota(begin, end, 2);
random_shuffle(begin,end);
but it looks like "iota" is an old legacy thang not really in the stl.
What's the easiest/quickest way to fill a vector up with random values.
thanks very much.
G