![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Vladimir Simakov:
YES!
I never would have guessed that variable values can be set by the necessary shift !
cool! thanks!
With complete economy of space:
another question... Is there any way to get a 12 bit int via union ?... never mind how ))))
ZS: ideally a 9-15 bit int , the sign is not a problem, i.e. it is possible to unsigned int (in the last builds MQL has learnedunsigned int, it is possible to use instead of uint )
Icho:
another question... Is there any way to get a 12 bit int via union ?... never mind how ))))
ZS: 9-15 bit int ideally , the sign to allocate is not a problem, i.e. it is possible unsigned int (in last builds MQL has learnedunsigned int, it is possible instead of uint to use )
Probably not. There are no half byte variables yet.
Probably not. There are no half bytes of variables yet.
Why not? Encode and mask the required bits, any number of bits can be used
but the problem is not to screw it up ;)
UPD: googling such a question, at least read what they advisehttps://stackoverflow.com/questions/29529979/10-or-12-bit-field-data-type-in-c
Why not? encode and mask the required bits, any number of bits can be used
but the problem is not to screw it up ;)
Then you can do without union too.
Then you can do without the union, too.
yes, union is more of a problem than a convenience
Any idea why the compiler uses the method in the base-class?
Any idea why the compiler uses the method in the base-class?
Because you are not overriding a virtual function, you are using overloading.