Code:
printf("\t\tPlease Choose:\n");
printf("\t\t[S]ales\n");
printf("\t\t[P]ayment\n");
printf("\t\t[E]xit\n");
printf("\t\tYour choice: ");
scanf(" %c", &choice);
while (choice != 'S' && choice != 's' && choice != 'P' && choice != 'p' && choice != 'E' && choice != 'e')
{
printf("\n\t\t*WARNING* INVALID INPUT\n\t\tPlease input your choice correctly: ");
scanf(" %c", &choice);
}
How do I change the line :
Code:
while (choice != 'S' && choice != 's' && choice != 'P' && choice != 'p' && choice != 'E' && choice != 'e')
into an Array?
For example,
Code:
char valid[] = {'S', 's', 'P', 'p', 'E', 'e'};
Then I call valid instead of using the long code? ;O