I have a program that is meant to continue looping as long as an entered character is 'y', but my code exits after one execution of the do-while loop.
int main()
{
char cont;
do {
printf("Would you like to continue (y/n)?: ");
scanf_s("%c", &cont, sizeof(cont));
} while (cont == 'y');
}
This will take in one key press and either exit or continue, as it's supposed to, but then immediately exit without waiting for more key presses.