I personally dislike switch case statements... not that it matters, however if I were you I would turn that big block of code in the middle into one function.
1 2 3 4 5
void displayRoll(int number){
if (number == 1)
diceOne();
if (number...... you get the point
}
This defines the function type of the diceXXX() functions, then creates a vector of dice functions initialized it to all of the defined functions. To execute the desired function, just look it up in the vector and call it.
This compiles with gcc 4.4 with "-std=c++0x". It may compile with VS2010 as well. Boost provides helpers to do most of that in C++98.
To answer your original question, you need a variable to track the player number. And then switch between 0 and 1. For example:
player = (player ? 0 : 1);
ultifinitus: better to use a vector rather than dynamic allocation.
Y'know something completely hilarious, the advanced computer programming class at my school literally just assigned this assignment. I'm starting to wonder if this is standard practice, do all comp prog teachers get their material from the same site? I'm sorry if this is seemingly pointless but I just couldn't help noticing...
@brownie3141: Hey man, I don't make the classes. It's also at a highschool level. And I'm not in the class, I just know the class and the teacher who teaches it. No offense taken.
Also: about vectors and dynamic allocation, vectors are harder to teach thouroughly (which means teaching the theory behind them) but dynamic allocation is harder to grasp the first time. As for use, I personally prefer dynamic allocation, but that's just me.