Fileöffner verbessert
This commit is contained in:
parent
eb15c18771
commit
3c68ced8ab
@ -9,11 +9,11 @@
|
||||
int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
|
||||
{
|
||||
//Erstellt Pointer auf textdokument
|
||||
FILE *textdokument = fopen("words.txt", "r");
|
||||
if (file == NULL) {
|
||||
printf("words,txt konnte nicht geoffnet werden");
|
||||
FILE *textdokument = fopen(file, "r");
|
||||
if (textdokument == NULL) {
|
||||
printf("Datei konnte nicht geoffnet werden");
|
||||
}
|
||||
// ToDo 2D char Array um wörter zu speichern kommt hier rein
|
||||
// 2D char Array um wörter zu speichern
|
||||
char word[MAX_WORD_LEN];
|
||||
unsigned int count = 0;
|
||||
while (fscanf(textdokument, "%s", word) != EOF && count < maxWordCount) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user