I got an undeclared identifier error from the follow code, but i have clearly declared the variable "length" in both cases. what did I do wrong?
int startWordLenRec(char s[]) { if (isLetter(s) == false){ int length = 0; } else if{ int length = 1 + startWordLenRec(s+1); } return length; }
return 0instead ofint length = 0and thenreturn lengthlater on.