Hi,
I used char in symbol but I got value=0, If use string then I got combile Error: 'arr' - structures or classes containing objects are not allowed testtoarray.mq4 68 33
You cannot store strings in a char.
You can have a string in a structure.
highlight the line where you get the error.
You cannot store strings in a char.
You can have a string in a structure.
highlight the line where you get the error.
Here I got error:
FileReadArray(file_handle,arr);
'arr' - structures or classes containing objects are not allowed testtoarray.mq4 68 33
AND
here:
FileWriteArray(handle,arr,0,n);
Here I got error:
FileReadArray(file_handle,arr);
'arr' - structures or classes containing objects are not allowed testtoarray.mq4 68 33
AND
here:
FileWriteArray(handle,arr,0,n);
you cannot write an array of structure data with FileWriteArray
there is a FileWriteStructure but the structure cannot contain strings.
You will need to change your data model and the way you save/read from files accordingly.
Hi,
I used char in symbol but I got value=0, If use string then I got combile Error: 'arr' - structures or classes containing objects are not allowed testtoarray.mq4 68 33
struct prices { char symbol[16]; // symbol double price; // price }; StringToCharArray("EURUSD",arr[count].symbol); CharArrayToString(arr[i].symbol)
You need a fixed length byte array.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I used char in symbol but I got value=0, If use string then I got combile Error: 'arr' - structures or classes containing objects are not allowed testtoarray.mq4 68 33