This commit is contained in:
maxgrf 2025-11-06 16:23:36 +01:00
parent 5c1aea7a88
commit cddbfb3029
4 changed files with 14 additions and 1 deletions

BIN
Start_Windows/game.o Normal file

Binary file not shown.

View File

@ -20,6 +20,19 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
while(word_parts != NULL && counter < maxWordCount) while(word_parts != NULL && counter < maxWordCount)
{ {
// Kopiere das Wort sicher in das words-Array
strncpy(words[counter], word_parts, MAX_WORD_LEN - 1);
words[counter][MAX_WORD_LEN - 1] = '\0';
// Alles in Großbuchstaben umwandeln
for(int i = 0; words[counter][i] != '\0'; i++)
words[counter][i] = toupper(words[counter][i]);
/*
for(i = 0; i < MAX_WORD_LEN -1; i++) //MAX = 100 for(i = 0; i < MAX_WORD_LEN -1; i++) //MAX = 100
{ {
words[counter][i] = toupper(word_parts[i]); //Großbuchstaben erzeugen words[counter][i] = toupper(word_parts[i]); //Großbuchstaben erzeugen
@ -29,7 +42,7 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
break; break;
} }
words[counter][i] = '\0'; //Stringdefinition vervollständigen words[counter][i] = '\0'; //Stringdefinition vervollständigen
*/
counter++; // Wort eingelesen, Wortzähler erhöhen counter++; // Wort eingelesen, Wortzähler erhöhen
word_parts = strtok(NULL, ",;\n\t/. "); //NULL für Zeiger angeben word_parts = strtok(NULL, ",;\n\t/. "); //NULL für Zeiger angeben
} }

BIN
Start_Windows/input.o Normal file

Binary file not shown.

BIN
Start_Windows/runTests.exe Normal file

Binary file not shown.