static void Main(string[] args) { int len = 100; float_complex[] src1 = new float_complex[len]; float_complex[] src2 = new float_complex[len]; float_complex[] dst = new float_complex[len]; for (int i = 0; i < len; i++) { src1[i].re = 2; src1[i].im = 0; src2[i].re = i; src2[i].im = 0; } CppWrapperClass cppWrapper = new CppWrapperClass(); cppWrapper.Mult2Vectors(src1, src2, dst, len); for (int i = 0; i < len; i++) { Console.WriteLine(dst[i].re); } Console.Read(); }
static void Main(string[] args) { int noElements = 1000; int[] array = new int[noElements]; for (int i = 0; i < noElements; ++i) { array[i] = i * 10; } unsafe { fixed (int* arr = &array[0]) { CppWrapperClass c = new CppWrapperClass(arr, noElements); int sumOfArray = c.sum; } } }
static void Main(string[] args) { int noElements = 1000; int[] array = new int[noElements]; for (int i = 0; i < noElements; ++i) { array[i] = i * 10; } unsafe { fixed(int *arr = &array[0]) { CppWrapperClass c = new CppWrapperClass(arr, noElements); int sumOfArray = c.sum; } } }