diff --git a/Start_Windows/input.c b/Start_Windows/input.c index 236fbf4..a5dfcb3 100644 --- a/Start_Windows/input.c +++ b/Start_Windows/input.c @@ -19,7 +19,7 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount) while(fgets(puffer, MAX_LINE_LEN-1, file) != NULL && counter < maxWordCount) { - char *parts = strtok(puffer, ",;/n/t. "); + char *parts = strtok(puffer, ",;\n\t/. "); while(parts != NULL && counter < maxWordCount) { @@ -27,11 +27,18 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount) //words[counter][MAX_WORD_LEN-1] = "\0"; //Großbuchstaben for(int i = 0; i < MAX_WORD_LEN -1 && parts[i] != '\0'; i++) + { words[counter][i] = toupper(parts[i]); + words[counter][i] = '\0'; + } } - counter++; - parts = strtok(NULL, ",;/n/t. "); + counter++; // Wort eingelesen -> Wortzähler erhöhen + parts = strtok(NULL, ",;\n\t/. "); } return counter; -} \ No newline at end of file +} + + + +//TODO: Wörter auf Zahlen, Umlaute überprüfen -> ändern \ No newline at end of file