diff --git a/Startcode/input.c b/Startcode/input.c index 0883c58..a98036e 100644 --- a/Startcode/input.c +++ b/Startcode/input.c @@ -11,10 +11,10 @@ static int createSingleWords(char text[MAX_LINE_LEN], char words[][MAX_WORD_LEN] unsigned int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount) { - int wordCount = 0; - char lineRead[MAX_LINE_LEN]; + unsigned int wordCount = 0; // Eingelesene Wörter + char lineRead[MAX_LINE_LEN]; // Aktuell eingelesene Zeile - while(fgets(lineRead, MAX_LINE_LEN, file) != NULL && wordCount < (int)maxWordCount) + while(fgets(lineRead, MAX_LINE_LEN, file) != NULL && wordCount < maxWordCount) { wordCount += createSingleWords(lineRead, words + wordCount, maxWordCount - wordCount); } @@ -27,16 +27,17 @@ static int createSingleWords(char text[MAX_LINE_LEN], char words[][MAX_WORD_LEN] char *teiler = " ;,.\r\n"; char *token; - int i = 0; + unsigned int i = 0; token = strtok(text, teiler); - while(token != NULL && i < (int)maxWordCount) + while(token != NULL && i < maxWordCount) { strncpy(words[i], token, MAX_WORD_LEN - 1); + //kleinbuchstaben --> GROßBUCHSTABEN int length = strlen(words[i]); - for(int j = 0; j < length; j++) + for(unsigned int j = 0; j < length; j++) { if(islower(words[i][j])) {