title: deprecated string constant to char conversion warning in CPP
body: <p>i'm trying the below basic program, where i'm getting a warning on compailing.</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;cstring&gt;
  
  using namespace std;
  
  class employee
  {
  private:
      char name[20];
      int age;
      float sal;
  public:
      void setdata (char *n, int a, float s)
      {
          strcpy (name, n);
          age = a;
          sal = s;
      }
      void showdata()
      {
          cout &lt;&lt; endl &lt;&lt; name &lt;&lt; '\t' &lt;&lt; age &lt;&lt; '\t' &lt;&lt; sal &lt;&lt; endl;
      }
  };
  
  
  int main ()
  {
  
      employee e1;
  
      e1.setdata("ajay", 23, 4500.50);
      e1.showdata();
      return 0;
  }
  </code></pre>
  
  <p>But, as soon as i compile this i get the below error;</p>
  
  <p><code>deprecated conversion from string constant to 'char*' [-Wwrite-strings]</code></p>
  
  <p>Please explain why am i getting this error, and also the resolution to eliminate. and how dose the resolution works..</p>
  
  <p>Thanks in advance.</p>