Passing parameter in C#

Posted by Lu Lu on Stack Overflow See other posts from Stack Overflow or by Lu Lu
Published on 2010-03-31T05:01:15Z Indexed on 2010/03/31 5:03 UTC
Read the original article Hit count: 395

Filed under:
|

In C++, I have a function:

void MyFunction(int p)
{
    p=5;
}

Assume, I have:

int x = 10;
MyFunction(x); // x = 10
MyFunction(&x); // x = 5

How to archive this in C# with condition: I create only one MyFunction. Thanks.

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET