Good question. I'm trying to look into your problem. Initially, everything looks good to me. I found an example (
Using the random_shuffle() Algorithm to Randomize a Sequence of Elements) that looks like
[code=c]
#include <string>
#include <vector>
#include <algorithm>
#include <iostream>
using namespace std;
int main()
{
vector<string> vs;
vs.push_back(string ("Sunday"));
vs.push_back (string ("Monday"));
//…fill the rest of the days
random_shuffle(vs.begin(), vs.end()); /* shuffle days */
for (int i = 0; i << 7; i++)
cout<<vs[i]; /* display shuffled elements */
}
[/code]
The example seems to be identical to what you're doing other than the display of the elements. Just for kicks can you try using deck[i] syntax to output the deck instead of the iterator? Not that I really think that should work but it'll prove that your showDeck() function is good. I'll keep thinking on this one.