From 23dd3242a6798de83ca7c3c935da7cdbbe342c49 Mon Sep 17 00:00:00 2001 From: fdai7172 Date: Wed, 8 Feb 2023 18:59:19 +0100 Subject: [PATCH] Name wir in Textdatei gespeichert --- src/Paper-Bin.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Paper-Bin.c b/src/Paper-Bin.c index d09123d..44a25c9 100644 --- a/src/Paper-Bin.c +++ b/src/Paper-Bin.c @@ -111,6 +111,7 @@ void Generatefield() { void addScoreboard() { + int ScorePoints; //Die txt wird geƶffnet FILE* fp = fopen("ScoreBoard.txt", "a+"); char name[255]; @@ -118,5 +119,7 @@ void addScoreboard() printf("Bitte gib deinen Namen ein:\n"); scanf("%s", name); + fprintf(fp, "%s %d\n", name, ScorePoints); + fclose(fp); }