Hmmm, my guess would be that you either pass s as another parameter or instantiate s outside of the method. If you choose the latter you will have to reset s once length = 0.
That's my guess anyway, hope it helps.
kimbokasteniv
Junior Poster in Training
50 posts since Nov 2006
Reputation Points: 13
Solved Threads: 4
Yes I had thought about that as well but where can I create the string I tried doing it directly outside of the method so that it was just within the class Recursion and I got flagged with errors. I will have to ask her if I can pass a string as a parameter. I'll let you guys know.
If you got errors when compiling, then I suspect that you did not declare s as a static variable.
You may already be aware of this, but it seems you would have to divide length by two otherwise your palindrome would be twice the requested length. This might bring up another issue of whether the requested length is an odd or even number.
kimbokasteniv
Junior Poster in Training
50 posts since Nov 2006
Reputation Points: 13
Solved Threads: 4
Hi namitiet07 and welcome to daniweb,
Did you have a question regarding this thread?
darkagn
Veteran Poster
1,197 posts since Aug 2007
Reputation Points: 404
Solved Threads: 200
nope. Just another of those idiots who start accounts for no reason other than to post nonsense that we've been plagued with lately.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337