title: C++ use of "friend"
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/17434/when-should-you-use-friend-in-c">When should you use &#39;friend&#39; in C++?</a>  </p>
  </blockquote>
  
  
  
  <p>So I know a class or function can be keyworded as friend but what does that mean and how do I use it? I've tried reading around but no one explains what the following means:</p>
  
  <pre><code>class x{
  public:
  friend function(int x);
  };
  </code></pre>
  
  <p>Why do i declare function a friend, what use does that give me. Also, what does it mean to declare a class a friend? thanks.</p>