// class.cpp
class A {
public:
void myFunct(vector <int>& myvect);
protected:
vector <int> myvect;
...
}
class B : public A {
public:
void myFunct(vector <int>& myvect);
...
}
...
int main( ) {
B newB;
newB.myFunct(//not sure how to do this) ;
}
It's very unclear what you're trying to do from the generic names, poor description and uncompilable code. Perhaps you could provide a little more context.
There's a vector in a base class that I'm passing by reference to a function (myFunct) in a derived class, and I need to call this derived function (myFunct) from main ? But it's not possible to access the same myvect from main. So do I just create a new vector in main and pass that by reference ?