generated from freudenreichan/info2Praktikum-Wortsalat
Letzter Feinschliff
This commit is contained in:
1 parent
26cbcd17e6
commit
7f3e18becf
3 files changed
+13
-7
No files matched your search
+4
-5
@@ -9,7 +9,7 @@
|
||||
int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
|
||||
{
|
||||
int c;
|
||||
unsigned int i = 0; // Wort
|
||||
unsigned int i = 0; // Wort
|
||||
unsigned int j = 0; // Zeichen im Wort
|
||||
|
||||
while ((c = fgetc(file)) != EOF)
|
||||
@@ -18,9 +18,9 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
|
||||
{
|
||||
if (j > 0)
|
||||
{
|
||||
words[i][j] = '\0';
|
||||
i++;
|
||||
j = 0;
|
||||
words[i][j] = '\0';
|
||||
i++;
|
||||
j = 0;
|
||||
|
||||
if (i >= maxWordCount)
|
||||
{
|
||||
@@ -53,6 +53,5 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
|
||||
printf("%u. Entry: %s\n", idx + 1, words[idx]);
|
||||
}
|
||||
|
||||
|
||||
return (int)i;
|
||||
}
|
||||
Reference in new issue
Block a user