MQL4 Reference Language Basics Operators Object Create Operator new
Object Create Operator newThe new operator automatically creates an object of a corresponding size, calls the object constructor and returns a descriptor of created object. In case of failure, the operator returns a null descriptor that can be compared with the NULL constant. The new operator can be applied only to class objects. It can't be applied to structures. The operator shall not be used to create arrays of objects. To do this, use the ArrayResize() function. Example:
It should be noted that object descriptor is not a pointer to memory address. An object created with the new operator must be explicitly removed using the delete operator. See also Initialization of Variables, Visibility Scope and Lifetime of Variables, Creating and Deleting Objects |