const char für word in zwei Funktionen weil words auch const char

This commit is contained in:
LukVal54 2025-11-02 10:25:41 +01:00
parent cb02cbb972
commit 59bd2faccd

View File

@ -69,7 +69,7 @@ void fillWordsaladRand(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], u
//Wird mit 0 initialisiert. Wenns null bleibt, bedeutet dies es gibt keine verfügbaren Positionen. //Wird mit 0 initialisiert. Wenns null bleibt, bedeutet dies es gibt keine verfügbaren Positionen.
int findPossiblePositions(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsigned int searchFieldLen, const char words[][MAX_WORD_LEN], int wordidx, Position positions[]) int findPossiblePositions(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsigned int searchFieldLen, const char words[][MAX_WORD_LEN], int wordidx, Position positions[])
{ {
char *word = words[wordidx]; const char *word = words[wordidx];
int wordlen = strlen(word); int wordlen = strlen(word);
int positionamount = 0; int positionamount = 0;
int rechtsfrei = 1; int rechtsfrei = 1;
@ -136,7 +136,7 @@ int fuelleSalatMitWörtern(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN
int gesetzteWörter = 0; int gesetzteWörter = 0;
int positionsamount; int positionsamount;
int positiongewählt; int positiongewählt;
char *word; const char *word;
for(int i = 0; i < wordcount; i++) //jedes Wort. for(int i = 0; i < wordcount; i++) //jedes Wort.
{ {
positionsamount = findPossiblePositions(salad, searchFieldLen, words, i, position); //für dieses Wort werden die Positionen gefunden positionsamount = findPossiblePositions(salad, searchFieldLen, words, i, position); //für dieses Wort werden die Positionen gefunden