fixes a "bug" with the buffer thing..

This commit is contained in:
dvorakmortonxd 2026-05-25 13:14:47 +02:00
commit 37640a0c84

1
main.c
View file

@ -125,6 +125,7 @@ int main() {
printf("\n\nINPUT BELOW:\n"); // DIVIDER
char fruit[20]; //MAX 20 CHARACTERS
printf("Pick a fruit: ");
fflush(stdout); // this forces the buffer to print NOW, fixing the "bug" in which it prints out everything AFTER the next line (scanf)
scanf("%s", fruit);
printf("\nYou choose %s as your fruit!", fruit);