7
int[] source = { 1, 2, 3 };
8
int[] target = new int[ source.Length ];
10
example.myArrayCopy( source, target, target.Length );
12
Console.WriteLine( "Contents of copy target array using default marshaling" );
15
target = new int[ source.Length ];
17
example.myArrayCopyUsingFixedArrays( source, target, target.Length );
18
Console.WriteLine( "Contents of copy target array using fixed arrays" );
21
target = new int[] { 4, 5, 6 };
22
example.myArraySwap( source, target, target.Length );
23
Console.WriteLine( "Contents of arrays after swapping using default marshaling" );
27
source = new int[] { 1, 2, 3 };
28
target = new int[] { 4, 5, 6 };
30
example.myArraySwapUsingFixedArrays( source, target, target.Length );
31
Console.WriteLine( "Contents of arrays after swapping using fixed arrays" );
36
static void PrintArray( int[] a )
38
foreach ( int i in a )
39
Console.Write( "{0} ", i );