This is constructor, see Structures and Classes
public: CTrade(); // what is the aim of this line??
Constructors and Destructors
A constructor is a special function, which is called automatically when an object of structure or class type is created, and is typically used to initialize class members. Further we will discuss only classes, all the discussed can be applied to structures also, unless otherwise specified. The name of the constructor must match with the name of the class. The constructor has no return type (you can specify the type of void). In MQL5 constructors do not have any input parameters. Thus, each class can have only one constructor.
Class members: strings, dynamic arrays and objects that require initialization will be initialized anyway regardless of the constructor presence or absence.
A destructor is a special function that is called automatically when a class object is destroyed. The name of the destructor is written as a class name with a tilde (~). Strings, dynamic arrays and objects, requiring deinitialization, will be de-initialized anyway, regardless of the destructor presence or absence. If there is a destructor, these actions will be performed after calling the destructor.
Destructors are always virtual, regardless of whether they are declared with the virtual keyword or not.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
that is a revision of me to how to creating class :
I turn out if you want to clear the sequence of program, parameter still needed in OOP program
What is the aim/job at line 9 ?
thanks