forked from freudenreichan/info2Praktikum-Wortsalat
clean up & commit
This commit is contained in:
1 parent
2e24fdcec3
commit
26d80b65af
1 file changed
+2
-2
+2
-2
@@ -8,7 +8,7 @@ int leseEinWort(FILE *file, char zielWort[])
|
|||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
int i = 0;
|
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;
|
int anzahl = 0;
|
||||||
while((leseEinWort(file, words[anzahl])) == 1 && anzahl < maxWordCount)
|
while((anzahl < maxWordCount && leseEinWort(file, words[anzahl])) == 1)
|
||||||
{
|
{
|
||||||
anzahl++;
|
anzahl++;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user