The only way to do that in C#/.NET is to use unsafe code and to declare one of the variables as a pointer.
However, this is not good advice for C# code. I would highly consider restructuring the code to be more C#-like or you're going to fight the language a lot.
Or, a better advice, how about compiling the code with the managed C++ compiler and wrapping it up in some nice real managed types instead of going through the hassle of porting?
Anyway, here's a LINQPad example, however, that shows what to do if you really must port it and need that ability:
void Main()
{
unsafe
{
int x = 10;
int* y = &x;
Debug.WriteLine("x=" + x + ", y=" + *y);
ChangeValue(ref x);
Debug.WriteLine("x=" + x + ", y=" + *y);
ChangeValue(ref *y);
Debug.WriteLine("x=" + x + ", y=" + *y);
}
}
static void ChangeValue(ref int value)
{
value += 10;
}
This will output:
x=10, y=10
x=20, y=20
x=30, y=30