It says "Dynamic array object", but iti is a general info page about static arrays as well.
Well, things can at some point get complicated because you are using an external DLL, involving (most likely) pointer arithmetic. It would be easier to make it directly inside MQL, but nevertheless, you can try after import, to put this line
int arraytest(int a, int & b [] ); /* I included braces */
It says "Dynamic array object", but iti is a general info page about static arrays as well.
Well, things can at some point get complicated because you are using an external DLL, involving (most likely) pointer arithmetic. It would be easier to make it directly inside MQL, but nevertheless, you can try after import, to put this line
Oh, and on calling, do not put [ ],,
best regards
Hi just thought I should give the community an update. Ultimately nothing worked. My guess is that it got pretty confused from the fact that I was trying to pass an INT + Array as function inputs. Ultimately I dropped the INT input (was just the array size) and I replaced it with a simple sizeof(a) command in C++ inside the .dll. It worked. Thanks all for you input!
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
I truly cannot see the issue here. If you have the solution, kindly provide it with a brief comment. Thanks
What are the parameters of your function, you wrote different things :
then
That's not the same.
What are the parameters of your function, you wrote different things :
then
That's not the same.
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 erro
r '] expression expected'
Hello,
You can read the documentation about Arrays here https://docs.mql4.com/basis/types/dynamic_array
It says "Dynamic array object", but iti is a general info page about static arrays as well.
Well, things can at some point get complicated because you are using an external DLL, involving (most likely) pointer arithmetic. It would be easier to make it directly inside MQL, but nevertheless, you can try after import, to put this line
Oh, and on calling, do not put [ ],,
best regards
Hello,
You can read the documentation about Arrays here https://docs.mql4.com/basis/types/dynamic_array
It says "Dynamic array object", but iti is a general info page about static arrays as well.
Well, things can at some point get complicated because you are using an external DLL, involving (most likely) pointer arithmetic. It would be easier to make it directly inside MQL, but nevertheless, you can try after import, to put this line
Oh, and on calling, do not put [ ],,
best regards
Hi just thought I should give the community an update. Ultimately nothing worked. My guess is that it got pretty confused from the fact that I was trying to pass an INT + Array as function inputs. Ultimately I dropped the INT input (was just the array size) and I replaced it with a simple sizeof(a) command in C++ inside the .dll. It worked. Thanks all for you input!