killer-curry
Oro.........?
- 2,521
- Posts
- 9
- Years
- Age 26
- Malaysia
- Seen Feb 26, 2021
Well, I been doing assignment about pokemon simulator and this problem occurs when comes to this part
void display_file_certificate()
{
printf("Do you wish to view your certificate for completing this game? (Y/N) \n");
scanf("%c", &choice);
switch (choice) {
case 'y':
case 'Y': strcpy(command, "program.txt"); system(command); break;
case 'n':
case 'N': printf("Thank you for playing our game! Do you wish to play again? (Y/N) \n");
scanf("%c", &choice);
if (choice == 'y' && choice == 'Y')
{
return main();
}
else if (choice == 'n' && choice == 'N')
{
exit(0);
}
break;
default: do {
printf("Error! Please input the correct letter!\n"); scanf("%c", &choice);
} while (choice == 'y' && choice != 'Y' && choice != 'n' && choice != 'N'); break;
}
return;
}
so , at the underline part, when i press yes the program said there is another process using so somehow i cannot continue and bold part is when I press N the rest of the process is ignored and goes to exit.
I do hope someone can help me to fix it, thank you very much to reply!
Spoiler:
void display_file_certificate()
{
printf("Do you wish to view your certificate for completing this game? (Y/N) \n");
scanf("%c", &choice);
switch (choice) {
case 'y':
case 'Y': strcpy(command, "program.txt"); system(command); break;
case 'n':
case 'N': printf("Thank you for playing our game! Do you wish to play again? (Y/N) \n");
scanf("%c", &choice);
if (choice == 'y' && choice == 'Y')
{
return main();
}
else if (choice == 'n' && choice == 'N')
{
exit(0);
}
break;
default: do {
printf("Error! Please input the correct letter!\n"); scanf("%c", &choice);
} while (choice == 'y' && choice != 'Y' && choice != 'n' && choice != 'N'); break;
}
return;
}
so , at the underline part, when i press yes the program said there is another process using so somehow i cannot continue and bold part is when I press N the rest of the process is ignored and goes to exit.
I do hope someone can help me to fix it, thank you very much to reply!