Hi everybody I am c++ beginner I am working on program to examine a user entered string to determine if it's a palindrome. I have the most of the code but still two problems the first one is In function ‘bool PalindromeTest()’and the second error is: error: ‘strrev’ was not declared in this scope
#include <iostream>
#include <cstring>
using namespace std;
char s[100];
char sr[100];
void InputString();
bool PalindromeTest();
void PrintMessage();
int main()
{
InputString();
return 0;
}
void InputString(int n=0)
{
cout<<"Input the string you wish to be tested";
cin.getline(s, 100);
if(strlen(s)>n)
PalindromeTest();
}
bool PalindromeTest()
{
bool rvalue = true;
strcpy(sr, s);
strrev(sr);
if(strcmp(s, sr) == 0)
{
rvalue=true;
PrintMessage();
}
else
{
rvalue=false;
PrintMessage();
}
void PrintMessage(bool rvalue)
{
if(true == rvalue)
cout<<"The entered string IS a palindrome"<<endl;
else
cout<<"The entered strins IS NOT a palindrome"<<endl;
}