lilmaniac2
5,000+ posts
Ask Me about SI Mag V4!
Alrighty my fellow caraudio friends I come to you with a problem.
I have to test for a palindrome using a recursive function. Here is my current gode
beg is passed in as 0, mod does nothing.
I have to test for a palindrome using a recursive function. Here is my current gode
beg is passed in as 0, mod does nothing.
Code:
bool testp (string testof, int length, int beg,int mod)
{
cout<<beg<<" "<<length<<endl;
if (beg>=length)
return true;
else
{
if (testof[beg]!=testof[length])
return false;
else
testp(testof,length-1,beg+1,mod);
}
}
