I have 2 classes let's say class a und b. And even a thrid class c.
class a and b should have acess to the functions of the same object of class c. I want to have a member like a reference. So the argument in the construktor of class a and b would be the object or something like that.
Because I'm new to the CLI syntax im kinda confused with the datatype reference class.
so a normal example wihtout CLI and classes would like that.
int c = 5;
int &a = c;
int &b = c;
so whenever I change the value of a or b it changes the value of c.
I'm not a native english speaker so please be friendly :3.
If your class of
c
is a ref class, you can use^
(handle) to reference it.like the code here
As for the tracking reference versus a handle, the difference is similar to a reference/out parameter in C# method versus the variable name.
For example, try the following code by yourself
when you call these two functions, you will notice the difference.
In your case, either will work.