I've been trying to put a loop inside this code but whenever I try to there seems to be an error. Whenever a whitespace is used it produces an Infinite loop of error. I tried Do while and Nested if loops but still nothing. Can Anyone help me?
int main ()
cout<<"Enter the word or sentence: ";
remove(word.begin(), word.end(), ' ');
if (word == string(word.rbegin(), word.rend()))
cout<<"It is a Palindrome"<<endl;
cout<<"It is not a Palindrome"<<endl;