From 27053a1a75b4ba0e896a30d9ccaf08e7793c2a71 Mon Sep 17 00:00:00 2001 From: Sophia Weber Date: Sat, 27 Jan 2024 13:01:30 +0100 Subject: [PATCH] Update inputHandling.c scanf replaced with fgets --- src/inputHandling.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/inputHandling.c b/src/inputHandling.c index 705251e..84033c1 100644 --- a/src/inputHandling.c +++ b/src/inputHandling.c @@ -3,6 +3,8 @@ char a[200]; -void input(){ - scanf("%s", a); +void input() { + printf("Geben Sie eine Rechenoperation ein (Bsp.: 1+1):\n"); + fgets(a, 200, stdin); //fgets statt scanf, holt den kompletten String inkl. Whitespace + printf("Ihre Berechnung: %s \n", a); }