It's difficult to say without seeing how exactly how you've done this so far, but probably you want to have a function that accepts the player number as an argument:
For example:
Code:
int rolldice (int player) {
[some code here]
}
int main () {
int roll, player;
player=2;
roll=rolldice(player);
}
If there's anything that's going to occur more than once, you might as well make it a function. To play until someone wins (a condition) use a looping conditional construct:
Code:
int main (int argc, char *[argv]) {
int roll, nofplayers=atoi(argv[1]), player, total[nofplayers], i;
for (i=0;i<nofplayers;i++) total[i]=0;
player=1;
while (total[player-1] < 21) {
roll=rolldice();
total[player-1]+=roll;
}
}
In this example "rolldice" does not need a player number argument.