0
I’m trying to play a little game, so I displayed a menu and then I used the command switch
to access the options, in case the user wants to play he selects 1 and will be asked to him the name of players 1 and 2, for this I used the get
but when I run the code it jumps player 1 and goes directly to player 2, how do I fix it? I am using so:
printf("Nome do Player1: ");
gets(player);
printf("\n");
printf("Nome do Player2: ");
gets(pl2);
NOTE: I correctly declared the vectors, and these codes are within the case 1
of switch
Opa, I did not know that the scanf worked in this case, already helped a lot, thanks, fgets is a little complicated and does not cover this work I’m doing, so the way is to use the scanf.. Thank you
– Leonardo
@Leonardovilarinho If you solved your problem, mark the answer as the solution, good night! :)
– Maicon Carraro
I marked there already..
– Leonardo