Arrays must be passed by reference, not value.
Can I get some help here guys please, so I do #import the relevant .dll and then before closing the #import statement I refer to my function as
int arraytest(int a, int & b);
Then somewhere along the code I have defined the following array:
int cc[5] = { 1, 2, 3, 4, 5 };
and try to pass it as argument in the function in the following way:
Alert(arraytest(5,cc[]));
That throws a compilation error '] expression expected'
Any ideas?
Thanks
Alert(arraytest(5,cc[]));
You have to pass variables. cc[] is not a variable name.
Can I get some help here guys please, so I do #import the relevant .dll and then before closing the #import statement I refer to my function as
Then somewhere along the code I have defined the following array:
and try to pass it as argument in the function in the following way:
That throws a compilation error '] expression expected'
Any ideas?
Thanks
Alert(arraytest(5,cc));
You have to pass variables. cc[] is not a variable name.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi Guys,
I am writing a simple loop through array elements as a .dll.
Using
as usual but I am unsure as to hoe to declare the function and then call it. I am using:
declaration:
Call in an Alert whatever this function returns:
This doesn't compile as it is throwing reference errors on b[].
Have you got any ideas?
Thank you so much for you help and interest.
dsds