Tuesday, 10 July 2012

How To Copy Array

How to copy array ?

 using System;
class arr
{
public static void Main()
{
int [] a=new int[4];
a[0]=1;
a[1]=2;
a[2]=3;
a[3]=4;
int[] b=a;
Console.WriteLine("third index value of an array is :"+b[2]);
}
}


Here copy all index of array from a to b.

No comments:

Post a Comment