title: C++ argument of type is incompatible with parameter of type
body: <p>I am trying to get stockname to my derived class using a return function, but it shows a error 'argument of type is incompatible with parameter of type'.
     strcpy(name,s.name()); //Problem
  I tried to make it a constant char but that made a couple of errors.
  I am making a project on stock market, text me your ideas.</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;conio.h&gt;
  #include&lt;fstream&gt;
  #include&lt;string.h&gt;
  using namespace std;
  class stock
  {
      char stockname[20];
      float istockprice;
      float fstockprice;
      int demand;
  public:
      void senter();
      void sdisplay();
      int demands()
      {
          return demand;
      }
      char name()
      {
          return s.stockname[20];
      }
  };
  class market : public stock 
  {
      char stocksell[20];
      char stockbuy[20];
      float sellprice;
      float rate;
  public:
      void marketdata();
      void rate();
      void search();
  };
  class transaction
  {
  public: 
      void credit();
      void debit();
      void transfer();
  };
  market m;
  transaction t;
  stock s;
  void market::rate()
  {
      m.rate = demands();
      m.rate += 1;
  }
  void market::search()
  {
      char name[30];
      strcpy(name,s.name()); //Problem
      ifstream search("Marketdata.txt");
      if (!search)
      {
          cout &lt;&lt; "Marketdata.txt file error";
          return;
      }
      //while (search.read((char*)&amp; m, sizeof(m)))
      //{
      //  if (strcmp(m.stocksell,name)==0)
          //{
  
          //}
  
  //    }
  }
  </code></pre>