Here is an example I made a bit rapidly with iterators...
#include <algorithm>
using std::copy;
using std::for_each;
using std::random_shuffle;
#include <iostream>
using std::cout;
using std::endl;
#include <vector>
using std::iterator;
using std::vector;
void Write(int i)
{
cout << i << endl;
}
int main()
{
const short MAX_LIST = 1000,
MAX_NUMBER = 100;
float number = 0;
vector<vector<float> > v (MAX_LIST),
v2 (MAX_LIST);
vector<float> list(MAX_NUMBER);
//Fills list and fills v with list
for(vector<vector<float> >::iterator v_iter = v.begin(); v_iter != v.end(); ++v_iter)
{
for(vector<float>::iterator list_iter = list.begin(); list_iter != list.end(); ++list_iter)
{
*list_iter = number;
++number;
}
*v_iter = list;
}
//write v to console
for(vector<vector<float> >::iterator v_iter = v.begin(); v_iter != v.end(); ++v_iter)
{
for_each(v_iter->begin(), v_iter->end(), Write);
}
//copy v to v2
cout << "Copying..." << endl;
copy(v.begin(), v.end(), v2.begin());
cout << "Finished copying!" << endl;
cout<< "Shuffling..." << endl;
random_shuffle(v2.begin(), v2.end());
cout << "Finished shuffling!" << endl;
//write v2 to console
for(vector<vector<float> >::iterator v_iter = v2.begin(); v_iter != v2.end(); ++v_iter)
{
for_each(v_iter->begin(), v_iter->end(), Write);
}
}