You can pass the pointer of 1 class to another.
Something like this...
Code:class A { public: int MyVariable; }; class B { public: A *MyA; void SomeFunction () { MyA->MyVariable = 10; } }; int main () { A varA; B varB; varB.MyA = &varA; // set the pointer of varA varB.SomeFunction (); // this function uses the varA-pointer to set MyVariable };




Reply With Quote
