title: error: no match for ‘operator=’ (operand types are ‘FILE and ‘FILE* )
body: <p>I am trying to get a file pointer by using pass by reference.
  I have a <code>fileInterface</code> for mocking the code for Unit test.</p>
  
  <p><strong>Function Definition for Actual Implementation:</strong></p>
  
  <pre><code>void openfile(FILE &amp;fileFP)
  {
      FILE *openedfileFP=setmntent(m_filename, m_mode);
      fileFP= openedfileFP;
  }
  </code></pre>
  
  <p><strong>Function Definition for UT:</strong></p>
  
  <pre><code>FILE *m_fileFP;
  void setfileFP(FILE * fileFP1)
  {
      m_fileFP=fileFP1;
  }
  void openfile(FILE &amp;fileFP)
  {
      fileFP= *m_fileFP;
  }
  </code></pre>
  
  <p><strong>Function Call:</strong></p>
  
  <pre><code>FILE *getFd = NULL;
  TestFd=fopen(path,mode);
  fileInterface-&gt;setfileFP(TestFd);
  fileInterface-&gt;openfilegetFd(getFd);
  </code></pre>
  
  <p>When I compile I get the following error :</p>
  
  <pre><code>no match for ‘operator=’ (operand types are ‘FILE {aka _IO_FILE}’ and ‘FILE* {aka _IO_FILE*}’)
           fileFP= openedfileFP;
  </code></pre>
  
  <p>Can someone please let me know what am I doing wrong?</p>