title: C++ friend function not working, private within this context error
body: <p>I've been doing an exercise for my programming course and the particular one I'm on now is about friend functions/methods/classes. The problem I'm having is that my friend function doesn't seem to be doing it's job; I'm getting "[variable name] is private within this context" errors around my code where I'm trying to access the variables that the friend function should have access to.</p>
  
  <p>Here is the class definition in the header file (I cut out unnecessary stuff to save space).</p>
  
  <pre><code>class Statistics {
  private: // The personal data.
  PersonalData person;
  
  public:
  Statistics();
  Statistics(float weightKG, float heightM, char gender);
  Statistics(PersonalData person);
  virtual ~Statistics();
  
  ...
  
  friend bool equalFunctionFriend(Statistics statOne, Statistics statTwo);
  friend string trueOrFalseFriend(bool value);
  };
  </code></pre>
  
  <p>Here is the method where the errors are appearing.</p>
  
  <pre><code>bool equalFuntionFriend(Statistics statOne, Statistics statTwo)
  {
  // Check the height.
  if (statOne.person.heightM != statTwo.person.heightM)
      return false;
  
  // Check the weight.
  if (statOne.person.weightKG != statTwo.person.weightKG)
      return false;
  
  // Check the gender.
  if (statOne.person.gender != statTwo.person.gender)
      return false;
  
  // If the function hasn't returned false til now then all is well.
  return true;
  }
  </code></pre>
  
  <p>So, my question is: What am I doing wrong?</p>
  
  <p>EDIT: Problem has been solved by Angew. Seems it was just a typo... Very silly me!</p>