ywang2:
//I define the global array.
string m_symbols[FX_GOODS_MAXNUM];
//set the value:
for(int i=0; i<FX_GOODS_MAXNUM;i++)
{
m_symbols[i]="abc";
}
for(int i=0; i<FX_GOODS_MAXNUM;i++)
{
Alert(m_symbols[i]); //print the string array to check the value, nothing is printed
}
Can anyone help me to solve the problem; thanks
string m_symbols[FX_GOODS_MAXNUM];
//set the value:
for(int i=0; i<FX_GOODS_MAXNUM;i++)
{
m_symbols[i]="abc";
}
for(int i=0; i<FX_GOODS_MAXNUM;i++)
{
Alert(m_symbols[i]); //print the string array to check the value, nothing is printed
}
Can anyone help me to solve the problem; thanks
Try this instead:
int start(){ //I define the global array. int FX_GOODS_MAXNUM = 4; string m_symbols[]; // leave the array empty as you will add the elements with the loop below for(int i=0; i<FX_GOODS_MAXNUM;i++){ // add one element on each iteration of the loop m_symbols[i]="abc"; Print("element number: ",i," = ",m_symbols[i]); // print the result in the experts tab on the client terminal } return(0); }
oneday:
Try this instead:
Thanks, oneday.
It works.
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
string m_symbols[FX_GOODS_MAXNUM];
//set the value:
for(int i=0; i<FX_GOODS_MAXNUM;i++)
{
m_symbols[i]="abc";
}
for(int i=0; i<FX_GOODS_MAXNUM;i++)
{
Alert(m_symbols[i]); //print the string array to check the value, nothing is printed
}
Can anyone help me to solve the problem; thanks