#include
#include<string.h>
using namespace std;
bool ispalindrome(string s,int l,int r)
{
if(l==r||l==0)
{
return true;
}
else
{
if(s[l]==s[r])
{
l++;
r–;
ispalindrome(s,l,r);
}
else{
return false;
}
}
}
int main() {
int n;
string s[n];
cin>>s;
int l=1;
int r=n;
if(ispalindrome(s,l,r)==true)
{
cout<<“true”;
}
else
{
cout<<“false”;
}
return 0;
//cout<<“Hello World!”;
}
i am getting error at line 28,whats wrong in my code .
i intialing string with suitable size.