<pre>#include <stdio.h> extern __declspec(dllexport) int* sum(); int* sum() { int a = 50, b = 80, sum, neg; sum = a + b; neg = b - a; int arr[2] = { sum, neg }; return arr; }
using System; using System.Runtime.InteropServices; namespace ConsoleApplication { class Program { [DllImport("Project2.dll")] unsafe public static extern int* sum(); static void Main(string[] args) { unsafe { int* array2 = sum(); Console.WriteLine("Value: " + array2[0]); } } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)