Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Passing C++ strings by reference
#12
Done for int/double:

Macro Macro205
Code:
Copy      Help
dll "myDLL" double'myfunc

ARRAY(double) arr.create(5)

arr[0]=1.0001
;...

double result=myfunc(&arr[0], arr.len)

out result


C++
Code:
Copy      Help
extern "C" __declspec(dllexport) double myfunc(double *pointerElement0, int arrlen);

double myfunc(double *pointerElement0, int arrlen)
{
,double result=0;
,
,for (int i = 0; i < arrlen; i++)
,{
,,result+=pointerElement0[i]; // ;; example
,}

return result;
}

Any ideas on how to receive an array of int or str?


Messages In This Thread

Forum Jump:


Users browsing this thread: 4 Guest(s)