I think my biggest trouble is trying to return a vector |
It looks like you just want to pass the vector by reference which you can do like this:
void DrawArray(vector<int>& Draw);
However, the biggest trouble I see is the logic within DrawArray. Whatever it's doing, it's
not keeping track of the number of tries for each of the
one million back to backs. You should have an array of 1000000 ints somewhere that keeps track of the counts (or you could print out the counts as they occur but I don't know if you're allowed to do that for this question, depending on what they mean by "stop and record").
Your "counter" loop does one-million-and-one iterations, not one million.
Your
num array has room for 99 elements though you don't reset
i back to zero, so there will be an array out of bounds eventually, not to mention the array out of bounds that happens right away when you try to do
num[i - 1]
when i is zero. You don't really need to keep track of the random numbers anyway, just the previous number and a counter storing how many numbers were used so far would suffice.
You also need to give your vector a starting size since accessing it like you're doing is also causing an array out of bounds.