Cannot reach a vector in a differend class using "Friend"
<p>I have 2 classes: <code>company</code> and <code>cpworker</code>.</p>

<p>Im trying to pass a vector in company to a function of <code>cpworker</code>, though when I try to reach the vector it doesn't let me:</p>

<p>In the <code>company</code> class:</p>

<pre><code>vector&lt;project&gt; projects;
friend void cpworker::registerWork();
</code></pre>

<p>In the <code>cpworker</code> class:</p>

<pre><code>void cpworker::registerWork()
{   
    for (int i = 0; i &lt; company.projects.size(); i++)
    {

    }
}
</code></pre>

<p>As you can see, I am trying to reach the size of the vector, but it does not let me..
Also, I didn't use a <code>get</code> method to company to return the size of the projects, because I need a full access to it inside the loop.</p>

<p>Here are the errors I'm getting (all in the for loop line):</p>

<blockquote>
  <p><code>* left of .projects must have class/struct/union</code><br>
  <code>* left of .size must have class/struct/union</code><br>
  <code>* type name is not allowed</code></p>
</blockquote>
