Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 547
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
Can you tell me. Where is the section on what settings. That is, the layout, checkboxes, arrows, etc.
Would you please decipher what it is about
Would you decipher what we're talking about
Thank you.
The condition passed, the error was in another part of the code. :)
In the help it is written that:
"Keep in mind that in MQL4 structure elements follow each other directly without alignment."
What do you mean by Alignment?
If I understood it correctly, the aligned elements will look like this:
and not aligned like this:Right?
What surprises me is that in programming the basic point is that the compiler skips spaces, but here it comes out that it affects something...
In the help it is written that:
"Keep in mind that in MQL4 structure elements follow each other directly without alignment."
What do you mean by Alignment?
If I understood it correctly, the aligned elements will look like this:
and non-aligned like this: Right?All deciphered in the comments
еще 4 байта пропуска. Обеспечили выравнивание на границу 8 байт
Elements of a structure can have different types and correspondingly different lengths in bytes, but memory for each element is allocated the same - by the maximum member. In the example, it is double 8 bytes.
In fact there are only 3 items in the structure but the first one occupies only 1 byte and we have to allocate 7 more bytes "empty" to align it with the last two items. It is easier to describe a specific structure like this
So the compiler adds the required number of bytes for each element? I mean spaces, which are not needed in the example?
And by the way, if
Structures may have different types and therefore different lengths in bytes, but memory for each item is allocated the same - by the maximum member. In the example, it is double 8 bytes.
If it is, and there is only one memory allocated for each element anyway, what difference does it make which order the elements of the structure are placed in?
So the compiler adds the required number of bytes for each element? I mean spaces, which are not needed in the example?
And by the way, if
If it is so and only one memory is allocated for each item anyway, what difference does it make in what order to arrange elements of the structure?
No, it doesn't. If you put int slippage first, 4 bytes will be allocated, so you should add up to 8 ( int reserve) or use long instead of int
Quotation from Help
The correct option, which does not require alignment, is
Please advise, I'm writing a multi-currency EA, pull out the ask and bid of other currencies, normalize, but there are still some extra digits in the price.
Digits should preferably be "pulled out" from the appropriate symbol as well ;)
Digits, too, should preferably be "pulled" out of the corresponding symbol ;)