~ubuntu-branches/ubuntu/maverick/swig1.3/maverick

« back to all changes in this revision

Viewing changes to Examples/csharp/arrays/runme.cs

  • Committer: Bazaar Package Importer
  • Author(s): Benjamin Drung
  • Date: 2009-11-15 14:00:28 UTC
  • mfrom: (1.2.9 upstream) (2.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091115140028-me7amr2rie8zz1xn
Tags: 1.3.40-2ubuntu1
* Merge from Debian testing (LP: #356529), remaining changes:
  - Drop libchicken-dev from the build-depends (it's in universe)
  - Remove Pike from package description and from configure flags
  - drop "--without-mzscheme", we don't have it in our build-depends
  - use php-config5
  - Clean Runtime/ as well.
  - debian/rules (clean): Remove Lib/ocaml/swigp4.ml.
* debian/rules: Remove hardcoded python version.
* Remove upper limit for python from Build-Depends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
using System;
 
2
 
 
3
public class runme
 
4
{
 
5
  static void Main() 
 
6
  {
 
7
    int[] source = { 1, 2, 3 };
 
8
    int[] target = new int[ source.Length ];
 
9
 
 
10
    example.myArrayCopy( source, target, target.Length );
 
11
          
 
12
    Console.WriteLine( "Contents of copy target array using default marshaling" );
 
13
    PrintArray( target );
 
14
 
 
15
    target = new int[ source.Length ];
 
16
    
 
17
    example.myArrayCopyUsingFixedArrays( source, target, target.Length );
 
18
    Console.WriteLine( "Contents of copy target array using fixed arrays" );
 
19
    PrintArray( target );
 
20
 
 
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" );
 
24
    PrintArray( source );
 
25
    PrintArray( target );
 
26
    
 
27
    source = new int[] { 1, 2, 3 };
 
28
    target = new int[] { 4, 5, 6 };
 
29
    
 
30
    example.myArraySwapUsingFixedArrays( source, target, target.Length );
 
31
    Console.WriteLine( "Contents of arrays after swapping using fixed arrays" );
 
32
    PrintArray( source );
 
33
    PrintArray( target );
 
34
  }
 
35
  
 
36
  static void PrintArray( int[] a ) 
 
37
  {
 
38
    foreach ( int i in a ) 
 
39
      Console.Write( "{0} ", i );
 
40
    Console.WriteLine();
 
41
  }
 
42
}
 
43