Well, I have the problem with the data updating in my counter int x. I am passing a lot of char* strings to my function, e.g. when I pass first char* of the length of 8, int x will be 8. Then if I pass the next char* of the length of 11, x still will hold the value of 8. Any advice on fixing it?
bool check(const char* word)
{
char checker[LENGTH+1];
int x = sizeof(word);
for(int a=0; a<x; a++) {
checker[a] = word[a];
}
for(int i=0; i < x-1; i++) {
//check if all chars are lower-case
if(checker[i] < 'a' && checker[i] != '\'') {
checker[i] = tolower(checker[i]);
}
}
}