hi again!! I did this question:
Create a class responsible for determining whether a string is a palindrome.
I did the code. but i have some errors that i dont know how to fix.
these are the errors:
1- syntax error before `)' token
2- syntax error before `)' token
3- In function `int main()':
4- ` Ispalindrome' undeclared (first use this function)
#include <iostream>
#include <conio.h>
#include <string.h>
using namespace std;
class palindrome
{
string s;
public:
palindrome()
{
s="null";
}
palindrome (string s1)
{
s=s1;
}
boolean Ispalindrome()
{
string s1 = s.reverse;
if (s==s1)
return true;
else
return false;
}
};
int main()
{
palindrome s1("How are you");
cout<<s1.Ispalindrome();
palindrome s2("BOB");
cout<<s2.Ispalindrome();
getch();
return 0;
}
Thanks for your help in advance!
itchap