Pass integer by ref
using System;
class MainClass
{
static void Main(string[] args)
{
int MyInt = 5;
MyMethodRef(ref MyInt);
Console.WriteLine(MyInt);
}
static public int MyMethodRef(ref int myInt)
{
myInt = myInt + myInt;
return myInt;
}
}
Output 10
|
HTML code for linking to this page:
Related in same category :
-
-
-
-
-
-
-
-
-
-
-
-
|