generated from freudenreichan/info2Praktikum-Wortsalat
return 0 if file not found
This commit is contained in:
parent
63cafdbc0c
commit
1affb13041
@ -9,6 +9,12 @@ static char *singleWordBuffer;
|
|||||||
// eine Funktion implementieren, die ein einzelnes Wort aus einer Textdatei (words.txt) einliest und als C-String zurückgibt.
|
// eine Funktion implementieren, die ein einzelnes Wort aus einer Textdatei (words.txt) einliest und als C-String zurückgibt.
|
||||||
char *readSingleWord(FILE *file)
|
char *readSingleWord(FILE *file)
|
||||||
{
|
{
|
||||||
|
if (file == NULL)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
fgets(singleWordBuffer, MAX_LINE_LEN, file);
|
fgets(singleWordBuffer, MAX_LINE_LEN, file);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user