I need to compare two strings for equality (case-insensitive) but my implementation is returning alot of warnings at compile.
my implementation:
//The word array will contain any number of strings of varying lengths
//string is the word to compare to
char **wordArray, char*string;
int i, sizeOfArray = 10
for(i = 0; i < 10; i++)
{
//Return 1 if the string is seen in the array
if(strcmp(tolower(wordArray[i]), tolower(string)) == 0)
return 1;
}
return 0;
I'm getting these warnings:
warning: passing argument 1 of ‘tolower’ makes integer from pointer without a cast [enabled by default]
note: expected ‘int’ but argument is of type ‘char *’
initialization makes pointer from integer without a cast [enabled by default]
How can i implement this