title: Why i am not able to compare an array of pointer and an array?
body: <p>I am getting error :  ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
  Can anyone please help me in resolving this error ???
  Here is my code......</p>
  <pre><code>#include&lt;iostream&gt;
  #include&lt;string.h&gt;
  #include&lt;conio.h&gt;
  #include&lt;ctype.h&gt;
  using namespace std;
  void main()
  {
      char *ptr[4] = {&quot;books&quot;,&quot;television&quot;,&quot;computer&quot;,&quot;sports&quot;};
      char str[10];
      cout &lt;&lt; &quot;Enter your favourite liesure pursuit : &quot;;
      cin &gt;&gt; str;
      for(int a=0;a&lt;4;a++)
      {
          if(!strcmp(str,ptr[a]))
          {
              cout &lt;&lt; &quot;Your favourite pursuit is available here \n&quot;;
          }
          else
          {
              cout &lt;&lt; &quot;\n Yopr favourite pursuit isn't available here \n&quot;;
          }
          getch();
      }
      
  }
  </code></pre>