diff --git a/Start_Windows/input.c b/Start_Windows/input.c index 4cd0faf..2111002 100644 --- a/Start_Windows/input.c +++ b/Start_Windows/input.c @@ -8,20 +8,22 @@ // Read words from file and store in 'words' array int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount) { - + puts("...."); char puffer[MAX_LINE_LEN]; //Array für eingelesene Zeile int counter = 0; //Zähler für Anzahl eingelesener Wörter int i; while(fgets(puffer, MAX_LINE_LEN-1, file) != NULL && counter < maxWordCount) { + puts(".!!!!!"); char *word_parts = strtok(puffer, ",;\n\t/. "); //Wörter aufteilen while(word_parts != NULL && counter < maxWordCount) { - for(i = 0; i < MAX_WORD_LEN -1 && word_parts[i] != '\0'; i++) + for(i = 0; i < MAX_WORD_LEN -1 || word_parts[i] != '\0'; i++) { words[counter][i] = toupper(word_parts[i]); //Großbuchstaben erzeugen + puts("?????????????????"); } words[counter][i] = '\0'; //Stringdefinition vervollständigen } diff --git a/Start_Windows/input.o b/Start_Windows/input.o index 48e204c..805ef15 100644 Binary files a/Start_Windows/input.o and b/Start_Windows/input.o differ diff --git a/Start_Windows/runTests.exe b/Start_Windows/runTests.exe new file mode 100644 index 0000000..109bcd1 Binary files /dev/null and b/Start_Windows/runTests.exe differ diff --git a/Start_Windows/testwords_delims.txt b/Start_Windows/testwords_delims.txt new file mode 100644 index 0000000..e721fce --- /dev/null +++ b/Start_Windows/testwords_delims.txt @@ -0,0 +1 @@ +Hund,Katze; Maus diff --git a/Start_Windows/testwords_empty.txt b/Start_Windows/testwords_empty.txt new file mode 100644 index 0000000..e69de29 diff --git a/Start_Windows/testwords_simple.txt b/Start_Windows/testwords_simple.txt new file mode 100644 index 0000000..37d7524 --- /dev/null +++ b/Start_Windows/testwords_simple.txt @@ -0,0 +1,3 @@ +Apfel +Banane +Kiwi \ No newline at end of file