The program ends fine when i enter "Q". but if I enter "1" first and then enter my name, once it loops back to the menu "Q" wont end it anymore.
help please
Code:
int main(int argc, char * argv[])
{
// Mainline Variable Declarations
FILE * output = stdout;
FILE * input = stdin;
int error=0;
char selection[2], name[20];
while (strcmp(selection,"Q")!=0)
{
fprintf(output,"\n1. First name\n2. ISO setting\n3. Aperture setting\n\nPlease enter a menu number or '?' for help\n"
);
fscanf(input,"%s",&selection);
if (strcmp(selection,"1")==0)
{
fprintf(output,"\nPlease enter your first name\n");
fscanf(input,"%s",&name);
error=1;
}
}
}