generated from freudenreichan/info2Praktikum-Wortsalat
test10
This commit is contained in:
parent
cddbfb3029
commit
28a2aa1ea1
Binary file not shown.
@ -20,17 +20,16 @@ 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
|
// Kopiere das Wort in words-Array
|
||||||
strncpy(words[counter], word_parts, MAX_WORD_LEN - 1);
|
strncpy(words[counter], word_parts, MAX_WORD_LEN - 1);
|
||||||
words[counter][MAX_WORD_LEN - 1] = '\0';
|
words[counter][MAX_WORD_LEN - 1] = '\0';
|
||||||
|
|
||||||
// Alles in Großbuchstaben umwandeln
|
// Alles in Großbuchstaben umwandeln
|
||||||
for(int i = 0; words[counter][i] != '\0'; i++)
|
for(i = 0; words[counter][i] != '\0'; i++)
|
||||||
|
{
|
||||||
words[counter][i] = toupper(words[counter][i]);
|
words[counter][i] = toupper(words[counter][i]);
|
||||||
|
printf("%c",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
|
||||||
@ -45,7 +44,7 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
|
|||||||
*/
|
*/
|
||||||
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
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return counter;
|
return counter;
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user