DotNet andd C++ example

This commit is contained in:
kdeng00
2020-08-16 16:51:37 -04:00
commit bc545e7caf
7 changed files with 110 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
using System;
using System.Runtime.InteropServices;
namespace DotnetAndCPP
{
class Program
{
static void Main(string[] args)
{
var a = 54;
var b = 23;
var result = add(a, b);
Console.WriteLine($"a: {a} + b: {b} = {result}");
}
[DllImport("libTestExample.so")]
public static extern int add(int a, int b);
}
}