Love Community,
I have a Problem with Pointer transfere betwen Classes / Objects.
I have a Class-A, this has as a public member a Pointer on a std:vector<ClassC>
I have access to this pointer by:
x->myvector.
So I must transfere this Pointer to a Class / Object called ClassB.
Class-B is initalized by a Function F() out of a Function in Class-A.
Initalize should be a Function in Class B which transfere any Information who Class-B needs to work.
So when I make a thing like:
F(this->myvector)
It seems that the vector would be copied
And not the Pointer would transfere.
But I need to work in Class-B and Class-A with the same and not equal vector - myvector.
Can anybody show me a solution for this Problem.
Hate Dude, To fix your Problem with Pointer transfere simply use the x->myvector pointer access with Class-A public member Pointer on a std:vector<ClassC>. Transfere this Pointer Class/Object initialized by Function F() of Class-B out of Class-A Function too. Any Information who Class-B needs to work with can transfere the copied Pointer with a thing like F(this->myvector). However since you need to work with same and not equal vector - myvector this Solution for the Problem is one.