I am trying the following code:
void OnInit()
{
int i = 0;
string d[];
while(i < 2)
{
ArraySetAsSeries(d,true);
for (int j=0; j<5; j++)
{
if(MathMod(j,2)==0 && i==0)
d[j] = "even";
else if(MathMod(j,2)==0 )
d[j] = "even without i zero";
else
d[j] = "odd";
}
i++;
}
}
I am willing to get output on testing. But I am getting the following error:
2018.03.23 14:51:20.005 EURUSD,M1 (MetaQuotes-Demo): generating based on real
ticks
2018.03.23 14:51:20.006 EURUSD,M1: testing of Experts\testing lines and trdae.ex5 from 2018.02.01 00:00 to 2018.02.20 00:00 started
2018.03.23 14:51:20.050 2018.02.01 00:00:00 array out of range in 'testing lines and trdae.mq5' (61,2)
2018.03.23 14:51:20.051 OnInit critical error
Kindly, help me get rid of this and print the array as I am willing to print it.
string d[];
should be a compile time error. – mchstring
? – Lundin