I am trying to wrap a C ++ function that has a reference parameter with C # code.
My c # shell class has
[DllImport(TestCppDLL.dll)] public static extern void foo(out int a, out int b, out double c); public void main() { int a; int b; double c; this.foo(out a, out b, out c); Console.WriteLine(a + b + c); }
And my C ++ code
extern void foo(int &a, int &b, double &c) { a = 1; b = 2; c = 3; }
So, I expect the result to be β123β, but I will get β000β.
How to bind a C ++ link parameter?
Thank you in advance,
source share