hi
can anyone help me
i have the code that checks the word entered a palindrome or not
it works in visual c++ but when i run the same in unix it is giving me errors can anyone tell me how to run it unix plz.....
#include <iostream>
#include <string> // This standard library file contains string functions
#include <cstdlib>
using namespace std;
int main( )
{
char str1[ 20 ] ,str2[20];
// int strrev,getchar;
cout<< "Enter String to be checked for Palindrome : \n";
cin>>str1 ;
strcpy(str2,str1); // Firstly copy original string ie. str1 into second string ie. str2
strrev(str2); // Now Reverse the second string ie. str2
if( strcmp(str1,str2) == 0 ) //Now compare oroginal string str1 with reversed string ie. str2
cout<< "String is Palindrome" ; // If str1 and str2 are same then the string is Palindrome
else
cout<< "String is not Palindrome" ; // otherwise string is not Palindrome
getchar();
}