title: i have to check if a string is palindrom or not using string iterate
body: <p>Why am I getting an error in the following code?</p>
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt;
  #include&lt;string&gt;
  using namespace std;
  
  int main()
  {  string str;
      string temp;
     string :: reverse_iterator it;
     cout&lt;&lt;&quot;enter the word&quot;&lt;&lt;endl;
     getline(cin,str);
     temp=str;
     cout&lt;&lt;temp;
  
       for(it=str.rbegin();it != str.rend(); it++)
  
       {
           cout&lt;&lt;*it;
  
  
       }
        if(temp.compare(*it)==0)
  
        cout&lt;&lt;&quot;palindrome&quot;;
        else cout&lt;&lt;&quot;not a palindrome&quot;;
  
  
       return 0;
  
  }
  </code></pre>
  <pre>
  main.cpp: In function 'int main()':
  main.cpp:29:23: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
         if(temp.compare(*it)==0)
                         ^~~~
  </pre>