forked from freudenreichan/info2Praktikum-Wortsalat
Merge branch 'main' of https://git.efi.th-nuernberg.de/gitea/engelpa103619/info2Praktikum-Wortsalat
This commit is contained in:
commit
b62d4a7b8c
2 files changed
+3
-3
No files matched your search
+1
-1
@@ -21,7 +21,7 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi
|
||||
{
|
||||
|
||||
|
||||
for(int i = 0; i < searchFieldLen; i++)
|
||||
for(int i = 0; i < searchFieldLen; i++) // jeden Platz erstmal mit EMTPY_CHAR ausfüllen
|
||||
{
|
||||
for(int j = 0; j < searchFieldLen; j++)
|
||||
{
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@ int leseEinWort(FILE *file, char zielWort[])
|
||||
{
|
||||
int c;
|
||||
int i = 0;
|
||||
while((c = fgetc(file)) != EOF) // liest aus Textdatei und überprüft ob End Of File ist
|
||||
while((c = fgetc(file)) != EOF) // liest aus Textdatei und überprüft ob End Of File ist. fgetc liest exakt ein einzelnes Zeichen. fgetc komplette Zeile
|
||||
{
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
|
||||
{
|
||||
|
||||
int anzahl = 0;
|
||||
while((leseEinWort(file, words[anzahl])) == 1 && anzahl < maxWordCount)
|
||||
while((anzahl < maxWordCount && leseEinWort(file, words[anzahl])) == 1)
|
||||
{
|
||||
anzahl++;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user