
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
Good afternoon. I am a beginner. I have a question regarding the use of the "*" icon (asterisk).
In the samplelist file:
"*" is used to declare a pointer to an object - this is kind of clear.
Next:
It is not clear what the "*" sign is used for.
According to the help,"it is possible to dynamically create objects of a complex type. This is done with the help of the new operator." The new operator is not used here. Please explain in more detail how and in what cases the "*" sign can be used.
Further, however:
It is not clear what the "*" sign placed there means.
You can write like this
There will be no difference, it concerns only the style of design and a small ideological approach.
You can write it like this
There will be no difference, it only concerns the style of design and a small ideological approach.
Ie.
CListItem *next(){return(next);}
this is a declaration of a pointer to the object (or method?) next()? And then, in curly brackets, the object next itself is returned? Do I understand correctly?
I understand that everything should be very simple, but since I haven't encountered OOP before, I'm wandering in 3 pines. Please make me understand.
I.e..
is a declaration of a pointer to the object (or method?) next()?
And then, in curly braces, the next object itself is returned? Do I understand correctly?
The body of the function is given in curly braces,
{return(next);}
it means that the function will return the variable next, which has the type of a pointer to an object of the CListItem class. This generally agrees with the type of the function.
Right after the first example, the article contains the phrase "The pstatus variable is a pointer of an object, but we deliberately "forgot" to create the object itself using the new operator and passed it as a parameter to the PrintStatus() function".
1. It's unclear what "exactly" you passed - a pointer or an object?
2. There is no PrintStatus() function in the example.
I think there is an error:
It appears that the new list element has prev and first referencing the second element, and the second element does not get a reference to the first element.Right after the first example, the article contains the phrase "The pstatus variable is an object pointer, but we deliberately "forgot" to create the object itself with the new operator and passed it as a parameter to the PrintStatus() function".
1. It is unclear what exactly was passed - a pointer or an object?
2. There is no PrintStatus() function in the example.
Better late than never. Thanks, fixed in the article. The end of the sentence has been removed
Right after the first example, the article contains the phrase "The pstatus variable is a pointer of an object, but we deliberately "forgot" to create the object itself using the new operator and passed it as a parameter to the PrintStatus() function".
I think there is an error:
It appears that the new list element has prev and first referencing the second element, and the second element doesn't get a reference to the first element.Yes, there's a typo. Instead of
should be
corrected.I still don't understand about pointers and references in MQL5 and now in MQL4. What is the difference between passing by reference and pointer except for extra code? There is a difference in C++, but what is it here? If it is not difficult, please write more detailed information.