From ad88cbbba6efe4dbda47c7f9267be3f8cc3b23ce Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 25 Oct 2025 17:50:41 +0200 Subject: [PATCH] uppercase fixed --- Start_Windows/input.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Start_Windows/input.c b/Start_Windows/input.c index 67084e8..673ae1c 100644 --- a/Start_Windows/input.c +++ b/Start_Windows/input.c @@ -13,7 +13,7 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount) char *token; file = fopen("words.txt", "r"); - if(file == NULL) + if (file == NULL) { printf("\nNot able to open file.\n"); fclose(file); @@ -29,14 +29,21 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount) while (token != NULL) { strncpy(words[n], token, MAX_WORD_LEN); + + char *s = words[n]; + while (*s) + { + *s = toupper((unsigned char)*s); + s++; + } + // printf("Einzelwort: %s\n", words[n]); token = strtok(NULL, teiler); n++; } - } - + fclose(file); - return 0; + return n; } \ No newline at end of file