added functionality to input.c

This commit is contained in:
Markus Kob 2025-10-30 17:15:56 +01:00
parent 8d8cb57e79
commit a1f73a0e33

View File

@ -8,5 +8,17 @@
// Read words from file and store in 'words' array
int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
{
char word[MAX_WORD_LEN];
// we possibly don't need fopen, since file is already a parameter
// fopen(stream)
fgets(word, MAX_WORD_LEN,file);
// fgets(string, length, file *stream)
strcpy(words[maxWordCount-1], word);
maxWordCount++;
// we possibly also won't need to close the
// fclose( *<stream>)
return 0;
}