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
Yes... Yes. This article is a masterpiece! Thank you so much to the author. I've had several attempts to conquer classes and still no luck. And after your article, it's like I had an epiphany. ;-)
And yet something in this article cuts my eye. Maybe I don't understand something? But please pay attention.
In the "Conclusion" section, paragraph 7"7. Virtual functions are declared by the virtualkeyword . If the descendant class has a function of the same name, it is executed; if it doesn't, the virtual function of the base class is executed."
And in the section "Some more about loading classes" there are lines like this: -"If you use an automatic pointer to the base class, the base class will be used as is. When calling its virtual functions, the code inside these functions will be executed. Virtual functions turn into regular functions."
So, I'm pointing all this out to the fact that in the "Conclusion" section in paragraph #7 you should specify that the word virtual serves to inherit derived classes when an object is declared of the base class type through a dynamic pointer. And if an object is declared of the descendant class type through an automatic pointer, then all the functions (from public and protected ) of the base class that are not of the same name are inherited with the functions of the descendant class. And in this case the word virtual has no meaning.
I attach the file "OOP_sDefaultVirtual_2.mq5", which clearly shows the work of the word virtual. Run the script with this word and without it.
And try to run your similar script "OOP_sDefaultVirtual_1.mq5" with and without the word virtual.
Well, are the syntax and capabilities much different in MQL4? I'm afraid to even look :)))
-
What does "alignment" mean?
Следует иметь ввиду, что в MQL4 элементы структуры следуют непосредственно друг за другом без выравнивания
Thanks for the article, it has helped me a lot. I am very weak in the use and understanding of CLASSES. Thank you very much, Hugs.
Look at the man tearing it up in English... hehehe
[ ]'s
Look at the man tearing up in English... hehehe
[ ]'s
You mean Google ripping on English. KKKKKK
Hi, Where to NOW. 2021
There is a great resource in codebase.
I am not interested in writing code from scratch. Interesting reading and learning this 2012 article.
My interest is using MT5 wizard to combine several EA's then edit them for my strategy.
Are there articles following on from this one that will grow my knowledge.
Thanks