I have defined a function where one of the parameters is out. Here, when the function call is made, I pass either a an initialized or an uninitialized argument. Now, in the case of an initialized argument, how do I make the callee not change the value of the out parameter?
I cant use a ref here because sometimes I do send an uninitialized argument. Ex:
void fun1()
{
int x = 3;
fun2 (out x);
int y;
fun2(out y);
}
void fun2(out int x)
{
...
}
Here, I dont want the x to lose the value 3 once control goes to fun2.