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
We need to move initialization to the initialization list.
Only static integral constants can be initialised in the declaration (at least in C++, I don't know yet in MQL5 :) )
Speaking of birds.
And what will the compiler answer to this? And it will answer the following '=' - illegal assignment use
The compiler was unbowed - '=' - illegal assignment use.
I have a question. What will happen if the programmer (in this case, me) doesn't initialize variables before using them (he/she does what the compiler requires and omits this moment in the constructor)?
The right way to initialize members of structures/classes in the constructor(s):
One more question, the last one. What is the reason that "" and NULL for strings are not equivalent?
properly initialise structure/class members in the constructor(s):
Yeah I figured that out over a year ago, at least since 2010 I've been doing it that way.
You could not have done it correctly since 2010, because the initialisation list was introduced quite recently :) .
NULL means the string is unallocated and "" the string is allocated and has a value.
You couldn't have done it right since 2010, as the initialisation list was only recently introduced :) .
You couldn't have done it right since 2010, as the initialisation list was introduced quite recently :) .
I meant initialization in class constructor and declaration as
I don't remember exactly, but I started working with objects at the beginning of 2010 (first quarter, I can't say exactly; and it's tedious to look for sources). Before that I was dealing with libraries and studying the basics of MQL5 (or rather, dealt with MQL5 migration issues).Do an overload function on different types of data in the array.
A simple script like this gives me strange results
Maybe someone can explain what's the reason? When number 254 is explicitly converted to uchar, it works as intended.