Laserlight is quite right, I misunderstood your problem, Transgalactic2.
In an earlier problem, I mentioned (and perhaps others did as well), that adding a getchar() after a scanf(), pulled the troublesome newline off the keyboard buffer.
In this case, the newline isn't the problem, Transgalactic2.
Here's a menu version that may suit you better. On bad input, it just prints the last line, one additional time, no matter how many letters you have of bad input there may be.
Also, it doesn't use conio.h, or any functions from conio.h.
Code:
#include <stdio.h>
int main(void) {
int gar;
int choice = 0;
int menu(void);
choice = menu();
printf("\n Your Choice Was %d ", choice);
printf("\n\n\t Program Complete - Press Enter When Ready \n");
gar = getchar(); gar++;
return;
}
int menu(void) {
int i, gar;
int number = 0;
char a1 = 178;
char a2 = 177;
char a3 = 176;
printf("\n\t\t %c%c%c Welcome to the Main Menu %c%c%c\n\n\n", a1,a2,a3, a3,a2,a1);
printf("\t Please Choose One of the Following Choices: \n\n");
printf("\t 1) Play a Game \n");
printf("\t 2) View The Highest Scores \n");
printf("\t 3) View All Scores \n");
printf("\t 4) Explore Game Options and Characters \n");
do {
printf("\t Your Choice [1-4]: ");
scanf("%d", &number);
while((gar = getchar()) != '\n'); //this line pulls off all the bad input
}while(number > 4 || number < 1);
return number;
}