VB, #.
VB ( ), out, .
, VB , . , .
#, , . , , "" , , "ref" .
, "out" . , , , , , VB, , . , . , ( ), , , .
, VB, , . , , , .
, :
class C
{
private int m_bar;
public int Bar { get { return m_bar; } set { m_bar = value; }}
void foo(out int x)
{
x = 2;
Console.WriteLine(Bar);
}
void DoStuff()
{
foo(out m_bar);
Bar = 0;
foo(out Bar);
Console.WriteLine(Bar);
}
}
DoStuff() foo, foo, , .
# .
, ( , , ).