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):
Interesting: 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 :) .
mql5:
NULL means the string is unallocated and "" the string is allocated and has a value.
OK, I'll put it another way. What's the point of inputting "not distributed" string state to the user? Can it be used in some useful way or is it just a crutch?
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).
Oops, got it. So, there is no universal way. The question arose because overloading results in identical functions with only one(!) difference - in the function header, when you have to specify an array type. Not exactly neat, but what can I do, I'll leave it that way. Was hoping there was a way out, like in the Reference Manual.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
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.