Oh, it's much more absurd example of a recursive method than famous recursive factorial!
It's rather rough C++ to C translation. Slightly better one:
int recursivePalindrome(const char *str, unsigned int index) {
unsigned length = (str?strlen(str):0);
... and so with obvious code correction
... and so on with obvious code correction. The matter is that str.length() is a simple property getter. Don't add once more nonsense - strlen call in a for loop condition...
ArkM
Postaholic
2,001 posts since Jul 2008
Reputation Points: 1,234
Solved Threads: 348