generated from freudenreichan/info2Praktikum-Wortsalat
Compare commits
16 Commits
4fea2c9f7b
...
a78c1e2ea2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a78c1e2ea2 | ||
|
|
c18b6a4529 | ||
|
|
013eba7b3d | ||
|
|
cd3dd0a4d6 | ||
|
|
b9138e2097 | ||
|
|
28a2aa1ea1 | ||
|
|
cddbfb3029 | ||
|
|
5c1aea7a88 | ||
|
|
f47f3aef7c | ||
|
|
b34074233d | ||
|
|
bbad6afd45 | ||
|
|
9e172b664f | ||
|
|
c26a55f965 | ||
|
|
16b0b9a450 | ||
|
|
85a79e9235 | ||
|
|
506c091bf6 |
Binary file not shown.
Binary file not shown.
@ -8,7 +8,6 @@
|
||||
// Read words from file and store in 'words' array
|
||||
int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
|
||||
{
|
||||
|
||||
char puffer[MAX_LINE_LEN]; //Array für eingelesene Zeile
|
||||
int counter = 0; //Zähler für Anzahl eingelesener Wörter
|
||||
int i;
|
||||
@ -19,14 +18,18 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
|
||||
|
||||
while(word_parts != NULL && counter < maxWordCount)
|
||||
{
|
||||
for(i = 0; i < MAX_WORD_LEN -1 && word_parts[i] != '\0'; i++)
|
||||
{
|
||||
words[counter][i] = toupper(word_parts[i]); //Großbuchstaben erzeugen
|
||||
}
|
||||
words[counter][i] = '\0'; //Stringdefinition vervollständigen
|
||||
// Kopiere das Wort in words-Array
|
||||
strncpy(words[counter], word_parts, MAX_WORD_LEN - 1);
|
||||
words[counter][MAX_WORD_LEN - 1] = '\0';
|
||||
|
||||
// Alles in Großbuchstaben umwandeln
|
||||
for(i = 0; words[counter][i] != '\0'; i++)
|
||||
{
|
||||
words[counter][i] = toupper(words[counter][i]);
|
||||
}
|
||||
counter++; // Wort eingelesen, Wortzähler erhöhen
|
||||
word_parts = strtok(NULL, ",;\n\t/. "); //NULL für Zeiger angeben
|
||||
}
|
||||
counter++; // Wort eingelesen, Wortzähler erhöhen
|
||||
word_parts = strtok(NULL, ",;\n\t/. "); //NULL für Zeiger angeben
|
||||
}
|
||||
return counter;
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Start_Windows/windows/unity.o
Normal file
BIN
Start_Windows/windows/unity.o
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user