I am currently using a struct to store players name, betting information for a simple Black Jack game.
Defined for 4 playersCode:struct player { char name[80]; char *hand[10]; int wins; int draw; int lost; float money; float currentbet; };
Now the players all get 1000 assigned to the money, however when they get to 0 in the money I have this figured out, however I wish to delete them so e.g If its player 2Code:struct player players[4];
players[1] is deleted.
Now my questions are
1) How do i delete this would i assign a pointer to players[1] and then use free?
2) When i delete the player what is going to happen to the above indexes would I require to copy them all into a temp array and then copy them back to the smaller array structure?
Sorry if this is confusing for anyone reading, I am quite confused on how to accomplish this.