Hello, I was preparing myself for the upcoming semester when I came across this problem that has caused me a bit of trouble. This is a program i've written that will accept two words from the user and use an iterative test and a recursive test to determine whether or not the words are anagrams. It will also get rid of unnecessary space and/or non alpha/numerical characters. The only part of the program that I am stuck on is the recursive part. If I enter these two words, ( word 1: kayleb word 2: kayllb ) I get the message that they passed the recursive test and failed the iterative. they should fail both tests, can anyone see the problem, I'm 99% sure it lies in the isAnagram_recursive function.
Thanks for any amount of input you guys may have.
Your program seems excessively complex. It would be much simpler to write an is_anagram() function that takes two strings (pass by value if you don't want to modify the strings), sorts the characters in the strings, then sees if the resulting sorted strings are the same. This may not answer your original question, but sometimes the answer is that *Yoda voice* asking the wrong question you are, mmmmhhhmmm.