schrempfde103950 committed 2026-10-29 10:05:02 +01:00
commit b62d4a7b8c
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -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
View File
@@ -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++;
}