W
Walter Roberson
My program should ask for repeating a calculation or not. I want to
solve it with a do..while, but the weird thing is that the program
totally ignores the scanf line where I want to receive the user input.
It starts the loop again by itself without receiving any input.
char quit;
do {
get_vars(pointer_on_m, results);
calculate(pointer_on_m, results);
printf("\n\rAnother calculation? (n for quit): ");
scanf("%c", &quit);
printf("\n\r");
}
while (quit != 'n');
Where is your EOF handling?
What -exactly- is your input? Is it *really* just the character 'n',
or is the user entering an 'n' followed by a return/enter? Where is
the input stream positioned after you read the first character?