From 5302d5ce9c79ce4842333e5bbbecb43eecf15db1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dami=C3=A1n=20Korpesio?= Date: Tue, 12 Oct 2021 19:20:19 +0200 Subject: [PATCH] skuska spravnosti --- cv2/program.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 cv2/program.c diff --git a/cv2/program.c b/cv2/program.c new file mode 100644 index 0000000..4046a28 --- /dev/null +++ b/cv2/program.c @@ -0,0 +1,31 @@ +#include +#include +#include + +#define LINESIZE 100 + +struct Pizza { + char name[LINESIZE]; + float prize; +}; + +int main() { + char line[LINESIZE]; + memset(line, 0, LINESIZE); + char name[LINESIZE]; + struct Pizza jedalny_listok[LINESIZE]; + memset(jedalny_listok, 0, sizeof(struct Pizza) * LINESIZE); + size_t velkost; + while (fgets(line, LINESIZE, stdin)) { + velkost = strlen(line); + if (velkost == 1 && line[velkost - 1] == '\n') { + break; + } + strcpy(jedalny_listok[0].name, line); + printf("%s\n", jedalny_listok[0].name); + + + } + + return 0; +} \ No newline at end of file