Another question: Do I have to specify the size of an array like this everytime "int array[50];" , I might not know the size.
See ArrayResize
"Do I have to specify the size of an array like this everytime "int array[50];" , I might not know the size."
To allocate memory for the array, you have to give it a size either in the declaration. ..
double myArray[100];
or before using it...
double myArray[]; // no size declared
...
ArrayResize(myArray, 100);
or
int sizeNeeded = someCalculation;
ArrayResize(myArray, sizeNeeded);
If you don't allocate memory for the array, it might work, it might work oddly,
it might crash the program.
Is it possible todo that in mql4?
I have some problem..
how to print out two array ?? (like the first case)
array[0][0] = 100;
array[0][1] = 1;
array[1][0] = 400;
array[1][1] = 2;
array[2][0] = 200;
array[3][1] = 3;
how to print out high value "400,2" ??
Hello ??? its imposible ??
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I see that mql4 has ArraySort and ArrayBSearch but all these only work on the first dimension.
Here is an example array and what I want to accomplish
array[0][0] = 100;
array[0][1] = 1;
array[1][0] = 400;
array[1][1] = 2;
array[2][0] = 200;
array[3][1] = 3;
I want to get the highest value 400 and print it out like this:
" 400 on 2 "
Another question: Do I have to specify the size of an array like this everytime "int array[50];" , I might not know the size.
Happy hOlidays