I have 2 classes: company
and cpworker
.
Im trying to pass a vector in company to a function of cpworker
, though when I try to reach the vector it doesn't let me:
In the company
class:
vector<project> projects;
friend void cpworker::registerWork();
In the cpworker
class:
void cpworker::registerWork()
{
for (int i = 0; i < company.projects.size(); i++)
{
}
}
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 get
method to company to return the size of the projects, because I need a full access to it inside the loop.
Here are the errors I'm getting (all in the for loop line):
* left of .projects must have class/struct/union
* left of .size must have class/struct/union
* type name is not allowed