I'm using Visual Studio 2005.
My problem is that I have a dll in C++ in which I have a function with one parameter that is double** which represents a dynamic two-dimensional array. For example:
double SumElementsDin(double** Array, int iRow, int iCol)
double dTemp = 0.0;
for(int i = 0; i < iRow; ++i)
for(int j = 0; j < iCol; ++j)
dTemp += Array[i][j];
I have a class in c# and I would like to call that function passing the array.
First of all, I don't know the best way to declare the function:
public static extern double SumElementsDin
// I don't know how to declare Array,
Then, in c# I don't know how to call the c++ function
public void my_function()
double[,] Array = new double[iNumRow, iNumCol];
// Call the c++ function ?
double Result = SumElementsDin(Array, iNumRow, iNumCol);