karan:
I know C/C++ and find the syntax of MQL4 to be compatible with C, However there are annoying differences such as not being able to do a pre decrement operator (--pos), etc.
How do you pass arguments to functions that modify the arguments. In C you can use pointers and in C++ you can additionally use a ref type. Is there any equivalent in MQL4?
use the '&' symbol in your parameter descriptions at the function level. ExampleI know C/C++ and find the syntax of MQL4 to be compatible with C, However there are annoying differences such as not being able to do a pre decrement operator (--pos), etc.
How do you pass arguments to functions that modify the arguments. In C you can use pointers and in C++ you can additionally use a ref type. Is there any equivalent in MQL4?
void MyFunction( int& count )
{
count = count + 1;
return;
}
What ever argument you pass this function it will get incrimented by one.
use the '&' symbol in your parameter descriptions at the function level. Example
void MyFunction( int& count )
{
count = count + 1;
return;
}
What ever argument you pass this function it will get incrimented by one.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
How do you pass arguments to functions that modify the arguments. In C you can use pointers and in C++ you can additionally use a ref type. Is there any equivalent in MQL4?