Код: Выделить всё
int v = 5;
ref int vv = ref v;
Listints = new ();
ints.Add(vv);
Console.Write ($"{ints[0]}"); // Prints 5
ints[0] = 6;
Console.Write ($"{ints[0]}"); // Prints 6
Console.Write ($"{v} and {vv}"); // Prints 5 and 5
vv = 7;
Console.Write ($"{v} and {vv}"); // Prints 7 and 7
В предыдущей версии C ++ программного обеспечения я просто использовал указатели (
Код: Выделить всё
&v
Подробнее здесь: https://stackoverflow.com/questions/794 ... read-write