generated from freudenreichan/info2Praktikum-Wortsalat
test9
This commit is contained in:
parent
5c1aea7a88
commit
cddbfb3029
BIN
Start_Windows/game.o
Normal file
BIN
Start_Windows/game.o
Normal file
Binary file not shown.
@ -20,6 +20,19 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int 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
|
||||
{
|
||||
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;
|
||||
}
|
||||
words[counter][i] = '\0'; //Stringdefinition vervollständigen
|
||||
|
||||
*/
|
||||
counter++; // Wort eingelesen, Wortzähler erhöhen
|
||||
word_parts = strtok(NULL, ",;\n\t/. "); //NULL für Zeiger angeben
|
||||
}
|
||||
|
||||
BIN
Start_Windows/input.o
Normal file
BIN
Start_Windows/input.o
Normal file
Binary file not shown.
BIN
Start_Windows/runTests.exe
Normal file
BIN
Start_Windows/runTests.exe
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user