Anyone know how I can stop the '1' (pressed for first choice) being displayed as the first char in the string asked for by fcn2? I have tried using kbhit to only call fcn2 when nothing is being pressed and using fflush(stdin) to clear anything in the buffer, but nothing works.
Another recent post here mentions using delays... how would that be done?
void menu() {
char choice;
printf("Enter Choice:\n\n 1 - First\n 2 - Second\n");
choice = getch();
switch (choice) {
case '1':
fcn2();
break;
case '2':
fcn3();
break;
}
}
void fcn2() {
char accept='n';
clrscr();
printf("Type something: ");
fgets(player.name, 80, stdin);
}
thanks...



LinkBack URL
About LinkBacks


