Passing R/W arrays to external libraries
Posted: Thu Dec 19, 2013 12:28 pm
Is it possible to pass an array as parameter to external library and change values of array by the library? All my trials ended up with access violation errors.
ZExternalLibrary:
Call from ZExpression:
Here is the corresponding C++ code:
ZExternalLibrary:
Code: Select all
void foo(int[] arr) {}
Code: Select all
int[10] arr;
foo(arr);
Code: Select all
export void foo(int* arr) {
int i = 0;
for(int i = 0; i < 10; ++i)
arr[i] = i;
}