Not sure where I'm going wrong.. I have two classes like so:
class One
{
public:
vector<Object*> myObjects;
};
class Two
{
public:
vector<Object*> * pointertoObjects;
};
I then want to create a pointer from pointertoObjects to myObjects and am doing so like this:
pointertoObjects = &myObjects;
But when I try to access to pass through an element:
void doFunction(Object * object);
doFunction(pointertoObjects[i])
it gives me an error:
Error: no suitable conversion function from std::vector<Object *, std::allocator<Object *>>" to "Object *" exists
Where have I gone wrong?