Hi. I've declared a vector and now I want to add 1 to every spot in it that comes up from a random number generator. So if the number 6 came up I would want to increment vector[6] by 1. I have code that looks like it should be working but gives an error everytime the program is run.
Code:vector <unsigned> Dicegame::PlayGame (unsigned numPlays) { for (unsigned i = 0; i < myPlaysPerGame; i++) { unsigned j = TossNDice(); myGameResult[j]++; } return myGameResult.size(); }