diff --git a/src/Paper-Bin.c b/src/Paper-Bin.c index c9fa602..8bc3c64 100644 --- a/src/Paper-Bin.c +++ b/src/Paper-Bin.c @@ -158,5 +158,14 @@ void sortScoreboard() { system("clear"); FILE *file = fopen("ScoreBoard.txt", "r"); + char line[1000]; + int numberOfLines = 0; + //Die Textdatei wird Zeile für Zeile eingelesen und in die Strukturliste eingefügt + for (int j = 0; fgets(line, sizeof line, file) != NULL && j <= 10; j++) + { + char* playertmp = strtok(line, " "); + strcpy(playerlist[j].Name, playertmp); + } + } } \ No newline at end of file