Here is my C function definition:
//C
int FXForwardRate(
long *riskZCDates, /* (I) Risk ZC dates */
double *fwdRate); /*(O) Output */
the first parameter is actually pointing to an array of long. In C# I would ideally like to call it like this:
//C#
int[] array = {1,2,3}; //if i'm not mistaking long in C is int in :NET
double fwdRate = 0;
Class1.FXForwardRate(array, ref fwdRate);
Now for my C++/CLI code I don't know how to declare the function in a Class1 class (I didn't put the whole code to be concise):
//C++/CLI
int Class1::FXForwardRateW(int[] premium, double %fwdRate)
{
double _tempFwdRate = 0.0;
int _status = FXForwardRate(premium, &_tempFwdRate);
fwdRate = _tempFwdRate;
return _status;
}
I know from another function I wrote that what I did for the second parameter is right (not sure it's the best method though). But how about the first one? Should I do the same thing? ie: define a pointer pass it to the C function and then copy the values back to the array? Regards