一组字符串,求最长字符
/*const char sentence[] = "our Tomorrow will be better";printf("%s\n",sentence);
int maxWordLength = 0,currentWordLength = 0,maxWordStartIndex = 0;
unsigned long str_len = strlen(sentence);
for (int i = 0; i < str_len + 1; i++) {
char character = sentence[i];
if (character != ' ' && character != '\0') {
currentWordLength ++ ;
}else{
if(maxWordLength < currentWordLength){
maxWordLength = currentWordLength;
maxWordStartIndex = i - currentWordLength;
}
currentWordLength = 0;
}
}
printf("startIndex = %d; maxLength = %d ",maxWordStartIndex,maxWordLength);
for (int i = maxWordStartIndex; i < maxWordLength + maxWordStartIndex; i++) {
printf("%c",sentence[i]);
}*/
不明白“int maxWordLength = 0,currentWordLength = 0,maxWordStartIndex = 0;”的意义,请大神能讲解一下