I wonder why you said "reference / pointer" ?. There is a big difference between these terms. See, Pointer is just an address, like int.
A link, on the other hand, is nothing more than an alias. From the point of view of C ++:
int x; int& y = x;
Here, regardless of what happens to x, what happens to y, and vice versa, they are attached "forever."
Again, in C ++, pass-by-ref:
void foo(int& y); int main(){ int x = 0; foo(x); }
This means that y, is simply a different name (alias) for x within the scope of foo. This is what ref means in C #.
Anzurio
source share