Show that using an instance of the System.Int32 stucture is the same as using the int keyword in CSharp
Description
The following code shows how to show that using an instance of the System.Int32 stucture is the same as using the int keyword.
Example
//from w w w .j a v a 2 s . c om
using System;
public class TestInt
{
static public void Main ()
{
System.Int32 x;
OutInt (out x);
Console.WriteLine ("The integer is " + x);
x = 42;
ShowInt (x);
ChangeInt (ref x);
Console.WriteLine ("The integer is " + x);
}
static void OutInt (out int val)
{
val = 42;
}
static void ShowInt (int val)
{
Console.WriteLine ("The value passed is " + val.ToString());
}
static void ChangeInt (ref System.Int32 val)
{
val *= 2;
}
}
The code above generates the following result.