title: c ++ , getting a 'no operator ">>" matches these operands'. For a function that reads a file
body: <p>I have the error in this code: in the while loop for '>>' in " in>>point"</p>
  
  <pre><code>void FileRead(const int cap,const string point,int counter)
  {
  
      ifstream in;
      in.open("sample_strings.txt"); //ifstream in;  in.open("sample_data.txt");
  
      if (in.fail())
          cout&lt;&lt;"sample_data not opened correctly"&lt;&lt;endl;
  
      while(!in.eof() &amp;&amp; counter&lt;cap)
      {
          in&gt;&gt;point[counter];
          counter++;
      }
  
      in.close();
  }
  </code></pre>
  
  <p>I tried implementing the operator >> I need but i still get the error.</p>
  
  <pre><code>ifstream &amp; operator&gt;&gt;(ifstream &amp; in, ARRAY &amp; Original)
  {
      cout&lt;&lt;"operator&gt;&gt; has been called\n";
  
      Original.counter = 0;
  
      while(!in.eof() &amp;&amp; Original.count&lt;Original.cap)
      {
          in&gt;&gt;Original. point[Original.counter];
          (Original.counter)++;
      }
  
      return in;
  }
  </code></pre>
  
  <p>I'm implementing the read file function to read into a constructor's array when i pass it</p>
  
  <p>the private functions I have are these</p>
  
  <pre><code>private:
  
  string *point;
  
  int counter;
  
  int cap;
  </code></pre>
  
  <p>I'm still new to c++, so any small help to understanding this would help.</p>