using System; using System.Runtime.InteropServices; using System.Text; using NagCFunctionsAPI; public class NagG05Functions { public static void nag_ref_vec_poisson (double t, ref IntPtr r, ref string error_message, ref int fail_code) { NagError fail = new NagError(); fail.char_array = new char [512]; NagFunctions.g05ecc(t, ref r, ref fail); string tmpstring = new string(fail.char_array); error_message = tmpstring; fail_code = fail.code; } public static void Main() { double t = 2.7; IntPtr r = new IntPtr(0); String error_message=""; int fail_code = 0; NagFunctions.g05cbc(0); nag_ref_vec_poisson (t, ref r, ref error_message, ref fail_code); if (fail_code != 0) { Console.WriteLine(error_message); } else { for (int i=0; i<5; i++) { Console.WriteLine("{0}", NagFunctions.g05eyc(r)); } } } }