PageRenderTime 52ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/rel-1.3.35/Examples/csharp/funcptr/runme.cs

#
C# | 27 lines | 18 code | 8 blank | 1 comment | 0 complexity | 0f8f5928f4710c133714c4204ff9ead9 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. using System;
  2. using System.Reflection;
  3. public class runme {
  4. public static void Main(String[] args) {
  5. int a = 37;
  6. int b = 42;
  7. // Now call our C function with a bunch of callbacks
  8. Console.WriteLine( "Trying some C callback functions" );
  9. Console.WriteLine( " a = " + a );
  10. Console.WriteLine( " b = " + b );
  11. Console.WriteLine( " ADD(a,b) = " + example.do_op(a,b,example.ADD) );
  12. Console.WriteLine( " SUB(a,b) = " + example.do_op(a,b,example.SUB) );
  13. Console.WriteLine( " MUL(a,b) = " + example.do_op(a,b,example.MUL) );
  14. Console.WriteLine( "Here is what the C callback function classes are called in C#" );
  15. Console.WriteLine( " ADD = " + example.ADD.GetType() );
  16. Console.WriteLine( " SUB = " + example.SUB.GetType() );
  17. Console.WriteLine( " MUL = " + example.MUL.GetType() );
  18. }
  19. }