From eb6781b9696e4c19f4aa17930ae7112a9ed70a2e Mon Sep 17 00:00:00 2001 From: dvorakmortonxd Date: Mon, 25 May 2026 21:24:29 +0200 Subject: [PATCH] fixed up the first input section of the code before implementing a new one --- main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index 853061c..ff6fd5e 100644 --- a/main.c +++ b/main.c @@ -123,14 +123,15 @@ int main() { LOIS.weight = 60; printf("Our woman is unknown, she is not %d years old and she weights %dkg. (LOIS.age and LOIS.weight).", LOIS.age, LOIS.weight); - // INPUT + // INPUT (BUT ONLY FOR ONE WORD! STOPS WHEN YOU PUT IN A SPACE) printf("\n\nINPUT BELOW:\n"); // DIVIDER - char fruit[20]; //MAX 20 CHARACTERS - printf("Pick a fruit: "); + char fruit[50]; //MAX 50 CHARACTERS + printf("Pick a fruit (SINGLE WORD, EVERYTHING ELSE GETS IGNORED): "); 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); + // END return 0; // THIS IS THE CURRENT END OF MY LESSON