Hello,
I am trying to write a wrapper function in C++/CLI over an existing
function in C++.
For instance, assume the C++ function is:
ComputeMedian(d ouble* x).
To create a C++/CLI wrapper, I created a function in C++/CLI which
looks like:
ComputeMedianIn terface(array<d ouble>^ x).
I want my ComputeMedianIn terface() function to call ComputeMedian()
internally. I somehow want to convert the input values array<double>^x
to double* x so that I do not have to modify the code within
ComputeMedian() .
The only way I could think of is by creating a copy (using malloc so
that I get the pointer) within ComputeMedianIn terface() and then
passing that as an argument to ComputeMedian() .
Is there any better way?
Thanks!
Vijay.
I am trying to write a wrapper function in C++/CLI over an existing
function in C++.
For instance, assume the C++ function is:
ComputeMedian(d ouble* x).
To create a C++/CLI wrapper, I created a function in C++/CLI which
looks like:
ComputeMedianIn terface(array<d ouble>^ x).
I want my ComputeMedianIn terface() function to call ComputeMedian()
internally. I somehow want to convert the input values array<double>^x
to double* x so that I do not have to modify the code within
ComputeMedian() .
The only way I could think of is by creating a copy (using malloc so
that I get the pointer) within ComputeMedianIn terface() and then
passing that as an argument to ComputeMedian() .
Is there any better way?
Thanks!
Vijay.
Comment