For school work, I need to create a game, for which I need to generate a random number to make it fair. In one case, as I'll post below, I need to designate a random number between 0 and 2 to modify in the string:
int NUM, AUX;
char PORTAS [0] = {'N', 'N', 'N'};
printf ("Entre com o número de participantes: ");
scanf ("%i", &NUM);
PART JOG [NUM];
for ( AUX = 0 ; AUX < NUM ; AUX++ ){
ent_info (&JOG [AUX], AUX);
}
AUX = rand () %3;
PORTAS [AUX] = 'S';
The problem is that every time, AUX gets the number 2 and I need to generate two more random numbers besides that. How can I get around this problem? Thank you.