文字列の配列があり、すべての文字を小文字に変換しようとしています。
void make_lower(char **array)
{
int i = 0;
while (array[i] != NULL){
array[i] = tolower(array[i]);
i++;
}
}
tolower 関数は文字列全体を一度に読み取るのではなく、文字を 1 つずつ読み取ることを知っています。そのため、このようなループを使用する必要があると考えましたが、それでも警告が表示され、関数は機能しません:
passing argument 1 of ‘tolower’ makes integer from pointer without
a cast [-Werror]
note: expected ‘int’ but argument is of type ‘char *’
assignment makes pointer from integer without a cast [-Werror]
よろしくお願いします。