From 8cc8450ae73cbfde0c85a996bde77cf58832f8da Mon Sep 17 00:00:00 2001 From: fdai7492 Date: Tue, 30 Jan 2024 23:05:50 +0000 Subject: [PATCH] =?UTF-8?q?Funktion=20f=C3=BCr=20User=20input,=20Anton=20L?= =?UTF-8?q?ohrey?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Input.c | 13 +++++++++++++ src/Input.h | 6 ++++++ 2 files changed, 19 insertions(+) create mode 100644 src/Input.c create mode 100644 src/Input.h diff --git a/src/Input.c b/src/Input.c new file mode 100644 index 0000000..aa44d91 --- /dev/null +++ b/src/Input.c @@ -0,0 +1,13 @@ +#include +#include +#include + +char* getUserInput() { + char *input = NULL; + size_t size = 0; + + printf("Ihre Eingabe: "); + getline(&input, &size, stdin); + + return input; +} diff --git a/src/Input.h b/src/Input.h new file mode 100644 index 0000000..132a3d4 --- /dev/null +++ b/src/Input.h @@ -0,0 +1,6 @@ +#ifndef INPUT +#define INPUT + +char* getUserInput(); + +#endif // INPUT