using System;
namespace Example43
{
///
/// Summary description for Class1.
///
class Class1
{
public static void CopyIt(int x, int y)
{
x = y;
}
public static void CopyIt(int[] x, int[] y)
{
for (int i = 0; i < y.Length; i++)
{
x[i] = y[i];
}
}
public static void PrintIt(int[] x, string y)
{
Console.Write(y);
for (int i = 0; i < x.Length; i++)
{
Console.Write(" " + x[i]);
}
Console.WriteLine();
}
///
/// The main entry point for the application.
///
[STAThread]
static void Main(string[] args)
{
int a = 1;
int b = 22229;
CopyIt(a,b);
Console.WriteLine("a=" + a + " b=" + b);
int[] data1 = { 1, 2, 3, 4, 5, 6, 7 };
int[] data2 = { 8, 9, 10, 11, 12, 13, 14 };
CopyIt(data1,data2);
PrintIt(data1,"data1");
PrintIt(data2,"data2");
}
}
}