I\'m working with the ref
and don\'t understand clearly \"Is it like a pointer as in C/C++ or it\'s like a reference in C++?\"
Why did I ask such a
A ref
in C# is equivalent to a C++ reference:
Some C++ code:
void foo(int& x)
{
x = 42;
}
// ...
int answer = 0;
foo(answer);
Equivalent C# code:
void foo(ref int x)
{
x = 42;
}
// ...
int answer = 0;
foo(ref answer);