|
@ -158,5 +158,14 @@ void sortScoreboard() |
|
|
{ |
|
|
{ |
|
|
system("clear"); |
|
|
system("clear"); |
|
|
FILE *file = fopen("ScoreBoard.txt", "r"); |
|
|
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); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |